There actually seems to be a mistake in the documentation:

> // Give me all Employees with lastName equal to Smith or Jones
    Query query = pm.newQuery(Employee.class,
                              ":p.contains(lastName)");
    query.execute(Arrays.asList("Smith", "Jones"));

Surely it should be:

> // Give me all Employees with lastName equal to Smith or Jones
    Query query = pm.newQuery(Employee.class,
                              "p.contains(:lastName)");
    query.execute(Arrays.asList("Smith", "Jones"));


On Feb 2, 10:29 pm, "Ikai L (Google)" <[email protected]> wrote:
> Oy, this is what I get for not running code before posting it. Good looking
> out.
>
> On Tue, Feb 2, 2010 at 1:06 AM, datanucleus <[email protected]>wrote:
>
>
>
>
>
> > >    query.setFilter("aliases == alias");
>
> > That is invalid JDOQL syntax; the spec is the spec and JDOQL uses Java
> > syntax.
> > If you have a collection field then the filter should be
>
> > aliases.contains(:alias)
>
> > The poster put the colon in front of a field name (wrong), and
> > declared a parameter as a variable (wrong).
>
> > --
> > 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
> > [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-appengine-java%2B 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App 
> Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to