That is incorrect. You can specify a filter using the == with a single value
and a list or set such as

            query.setFilter("keywords == keywordParam");
            query.declareParameters("String keywordParam");

This works just fine in JDO on AppEngine.



On Fri, Jan 7, 2011 at 8:06 AM, Matthew Adams <matt...@matthewadams.me>wrote:

> Your query as written is testing for whether oneLocation is equal to
> locations and oneCategory is equal to categories.  That will never be
> true (I hope), because a Set<Key> will never equal a Key.  What you
> mean is are they **contained by** their respective collections:
>
> select AdPost where locations.contains(oneLocation) &&
> categories.contains(oneCategory)
>
> See section 14.6.2 (p.167) of the JDO 3.0 specification, covering
> JDOQL filter expressions.  Page 170 contains a table of the methods
> allowed in JDOQL.  The JDO 3.0 specification can be downloaded from
> http://jcp.org/aboutJava/communityprocess/mrel/jsr243/index3.html
>
> -matthew
>
> On Jan 7, 5:24 am, Ravi Sharma <ping2r...@gmail.com> wrote:
> > Hi,
> > I have a entity like this
> > Class AdPost{
> > ...few property
> > Set<Key> locations;
> > Set<Key> categories;
> >
> > }
> >
> > when i am running a query like
> > select AdPost where locations = oneLocation && categories == oneCategory
> > (pseudo code)
> > where oneLocation is one valid key of a location and oneCategory is a
> valid
> > key of one category.
> >
> > After running this i expect to get list of AdPost but  it returns me null
> > and no error.
> > Is it allowed to run euqality on two collection property in same query?
> >
> > Thanks,
> > Ravi
>
> --
> 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-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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-j...@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.

Reply via email to