It appears as though your filter is testing whether "oneLocation" and
"oneCategory" are actually equal to the collections "locations" &
"categories", respectively.  I think what you mean to ask is whether
the collections **contain** the keys in question:

... where locations.contains(oneLocation) &&
categories.contains(oneCategory)

A Set<Key> will never (I hope) return true from equals(Object) when
passing in a Key.  See section 14.6.2 (beginning on p.167) of the JDO
3.0 specification for the filter specification.  Page 170 lists the
various methods supported JDOQL.  You can find the specification at
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.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to