I have some slow code:
val users:List[User] = Tag.findAll(By(Tag.tagType,this), OrderBy
(Tag.created_at, Descending), MaxRows(100), PreCache(Tag.user)).map
(_.user.obj.open_!)
That I turned into faster ugly code:
val users:List[User] = User.findAll(BySql("WHERE id IN (SELECT TOP 100
user from Tag where tagType = ? ORDER BY created_at DESC )",
IHaveValidatedThisSQL("trevoraustin","2009-11-30"), this.id))
That I want to turn into faster nicer code:
val users:List[User] = User.findAll(In(User.id, Tag.user, By
(Tag.tagType, this), OrderBy(Tag.created_at, Descending), MaxRows
(100)))
But I get the error:
"no implicit argument matching parameter type (Product with
net.liftweb.mapper.QueryParam[_ <: com.udorse.lift.model.Tag]) =>
net.liftweb.mapper.QueryParam[com.udorse.lift.model.Tag] was found."
If I try just:
val users:List[User] = User.findAll(In(User.id, Tag.user, By
(Tag.tagType, this), OrderBy(Tag.created_at, Descending)))
Without the MaxRows it compiles fine. Is there a limit on the
QueryParams I can use with In? Am I doing something else wrong?
--
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.