Also, I get this error: *Can only filter by properties of a sub-object if the sub-object is embedded.* when I tried to access article while setting a fitler: query.setFilter("reviewer == reviewerParam && article.status = articleStatusParam");
What am I missing? On Sat, Aug 22, 2009 at 6:02 PM, Sam Walker <am.sam.wal...@gmail.com> wrote: > In the second model, how will I find all Articles being reviewed by A and > B? > > The only way I can think of is adding another derived field in Article: > > Article { > HashSet<Review> reviews; > HashSet<Reviewer> reviewers; // keys of Reviewers to help the query "find > all articles reviewed by A and B" > HashSet<String> tags; > int status; // derived from all Reviews' statuses. > } > > Review { > Article article; > Reviewer reviewer; > int status; > } > > Now I should be able to do "reviewers.contains(A.key) and > reviewers.contains(B.key)". Is that the best way? > > > On Sat, Aug 22, 2009 at 2:02 PM, Sam Walker <am.sam.wal...@gmail.com>wrote: > >> Oh sweet, I didn't know that. >> >> That's awesome! Thanks for the quick reply. >> >> >> On Sat, Aug 22, 2009 at 1:51 PM, datanucleus <andy_jeffer...@yahoo.com>wrote: >> >>> >>> > I dont think I can do sth like (I can't access article.tags, >>> article.status >>> > as far as I know, correct?): >>> >>> Of course you can. JDO spec defines JDOQL, using Java syntax. >>> >>> > query.setFilter("reviewer == reviewerParam && status == statusParam && >>> > article.tags == tagParam && article.status = articleStatusParam"); >>> >>> What is "tagParam" ? an element of the hashSet? >>> You can't do "Collection == element" in Java so you can't in JDOQL. >>> You could do "article.tags.contains(tagParam)" >>> >>> >>> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~----------~----~----~----~------~----~------~--~---