class List extends LongKeyedMapper[TipList] with IdPK {
object tips extends HasManyThrough(this, Tip, TipListBind,
TipListBind.listid, TipListBind.tipid)
}
class Tip extends LongKeyedMapper[TipList] with IdPK {
object user extends MappedLongForeignKey(this, User)
}
class TipListBind extends LongKeyedMapper[TipList] with IdPK {
object tipid extends MappedLongForeignKey(this, Tip)
object listid extends MappedLongForeignKey(this, List)
object xtimestamp extends MappedDateTime[TipUserBind](this)
}
So if I'm dealing with all the Tips that are in a List, and I care
about the users on those tips I get an N+1 query situation. Is there
any way to PreCache Tip.user with the HasManyThrough?
I'd also really like to sort the tips based on the xtimestamp in
TipListBind. Kind of makes me think that HasManyThrough should take a
QueryParam*. It could even handle By() type QueryParams if I wanted
to only get some of the Tips based on fields in TipListBind (say all
the tips where TipListBind.xtimestamp > NOW() - 10 DAY).
-harryh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---