You must use declareParameters with dates as follows.
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(2000, 0, 1);
Date date = calendar.getTime();
Query query = pm.newQuery(Person.class, "this.birthDate >= date");
query.declareParameters("java.util.Date date");
Collection result = (Collection)query.execute(date);
see: http://www.objectdb.com/database/jdo/manual/chapter7/
On May 6, 10:41 am, kldaniels <[email protected]> wrote:
> I am trying to run the following type of query
>
> Select * from myTable where decisionDate > 2010-12-4
>
> I am trying this with:
>
> query.setFilter("decisionDate > new DATE(2010,12,4)");
> query.setOrdering("decisionDate desc");
>
> but this throws:
> javax.jdo.JDOUserException: CreatorExpression defined with class of
> DATE yet this class is not found
>
> leaving out the "new" does not work either and results in:
>
> DatastoreQuery$UnsupportedDatastoreFeatureException:
> Problem with query <SELECT FROM com.playatomo.gandalf.server.myTable
> WHERE decisionDate > DATE(2010,12,4) >: Unsupported method
> <DATE> while parsing expression:
> InvokeExpression{[null].DATE(Literal{2010}, Literal{12}, Literal{4})}
>
> The only documentation I can find on this is at:
>
> http://code.google.com/appengine/docs/python/datastore/gqlreference.html
>
> and it is pretty hard to understand.
>
> --
> 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
> athttp://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 [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.