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
>   def getBazes = {
>     Baz.findAll(...)
>   }
>
> }
>
> class Bar extends LongKeyedMapper[Bar] with IdPK
>   object fooid extends MappedLongForeignKey(this, Foo)
>
> }
>
> class Baz extends LongKeyedMapper[Baz] with IdPK
>   object barid extends MappedLongForeignKey(this, Bar)
>
> }
>
> How do I write Baz.findAll(...) so it will give me all the Bazes that
> point to any Bars that point to the Foo.  In SQL I would write
> something like this:
>
> SELECT * FROM bazzes WHERE bazzes.barid = bars.id AND bars.fooid =
> 111;   (where 111 is foo.id)
>
> I feel like I should be using ByRef here?  But it's not clear to me
> how to do it.
>
> -harryh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to