Way to do a query subset?

9 views
Skip to first unread message

jmunning

unread,
Mar 16, 2012, 4:07:37 PM3/16/12
to siena-...@googlegroups.com
Does Siena have the ability to perform a query, retrieve rows and then reuse that set of rows in multiple queries with different filter params?

i.e.   List<Foo> foos =  Foo.all().filter("bar", "baz").fetch()

and then perform queries against this subset?

Thanks.

Antonio de Sousa Barroso

unread,
Nov 2, 2012, 7:13:22 AM11/2/12
to siena-...@googlegroups.com, jasonm...@gmail.com
Hi,

the answer is yes, but the filter will be in the subset of results obtained in the previous (left) filter expression:

// Retrieves all the events of user for particular team (users can belong to more than one team)
Events.all()
          .filter("team", team)
          .filter("member", member)
          .order("-start")
          .fetch(); 

I hope this can help you
Antonio

Reply all
Reply to author
Forward
0 new messages