[Lift] Re: how to do basic joins

2009-08-19 Thread David Pollak
On Sat, Aug 15, 2009 at 11:14 AM, harryh har...@gmail.com wrote: class Foo extends LongKeyedMapper[Foo] with IdPK { def getBazes = { Baz.findAll(In(Baz.barid, Bar.id, By(Bar.fooid, this))) } OK, upgrading to 1.1-M4 got rid of the NPE so I'm just gonna assume there was a bug that

[Lift] Re: how to do basic joins

2009-08-15 Thread harryh
class Foo extends LongKeyedMapper[Foo] with IdPK {  def getBazes = {    Baz.findAll(In(Baz.barid, Bar.id, By(Bar.fooid, this)))  } OK, upgrading to 1.1-M4 got rid of the NPE so I'm just gonna assume there was a bug that has been fixed. However the SQL query that lift is generating is no

[Lift] Re: how to do basic joins

2009-08-14 Thread harryh
Please post a reproducible example.  I use this call pretty regularly and have not seen any problems. Sure thing. I will put something together tomorrow. If feel like I must be making a silly newbie mistake of some kind because I'm sure that you (and others) must be doing this sort of things

[Lift] Re: how to do basic joins

2009-08-13 Thread jon
One possibility is to do Baz.findAllBy{PreparedStatement,InsecureSql} (section 6.3.2 of lift book) I am also curious if there is a safe way to construct a join. - Jon On Aug 13, 3:41 pm, harryh har...@gmail.com wrote: I have 3 classes like so class Foo extends LongKeyedMapper[Foo] with IdPK

[Lift] Re: how to do basic joins

2009-08-13 Thread David Pollak
On Thu, Aug 13, 2009 at 12:41 PM, harryh har...@gmail.com wrote: I have 3 classes like so class Foo extends LongKeyedMapper[Foo] with IdPK def getBazes = { Baz.findAll(...) } } Baz.findAll(In.fk(Baz.barid, By(Bar.fooid, this.id))) class Bar extends LongKeyedMapper[Bar] with

[Lift] Re: how to do basic joins

2009-08-13 Thread David Pollak
Sorry... try: class Foo extends LongKeyedMapper[Foo] with IdPK { def getBazes = { Baz.findAll(In(Baz.barid, Bar.id, By(Bar.fooid, this))) } } object Foo extends Foo with LongKeyedMetaMapper[Foo] class Bar extends LongKeyedMapper[Bar] with IdPK { object fooid extends

[Lift] Re: how to do basic joins

2009-08-13 Thread harryh
Now I get an NPE :( Message: java.lang.NullPointerException net.liftweb.mapper.In$$anon$3.init(MetaMapper.scala:1206) net.liftweb.mapper.In$.apply(MetaMapper.scala:1200) com.harryh.model.Venue.checkins(Venue.scala:40) -harryh

[Lift] Re: how to do basic joins

2009-08-13 Thread David Pollak
Please post a reproducible example. I use this call pretty regularly and have not seen any problems. Also, what version of Lift are you using? On Thu, Aug 13, 2009 at 2:31 PM, harryh har...@gmail.com wrote: Now I get an NPE :( Message: java.lang.NullPointerException