My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 111: JPA support for JPQL functions CURRENT_TIMESTAMP, CURRENT_DATE
3 people starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  ----
Closed:  Aug 2009


Sign in to add a comment
 
Reported by mcaslavsky@gmail.com, Aug 10, 2009
When executing a JPA query with where condition comparing java.util.Date
property of an entity with any of JPQL functions (especially
CURRENT_TIMESTAMP, CURRENT_DATE, CURRENT_TIME) the following exception is
thrown:

org.datanucleus.store.appengine.query.DatastoreQuery
$UnsupportedDatastoreFeatureException: Problem with query <SELECT FROM
MyEntity WHERE endDate>=CURRENT_TIMESTAMP>: Unsupported method
<CURRENT_TIMESTAMP> while parsing expression: InvokeExpression
{[null].CURRENT_TIMESTAMP(<none>)} 

Please at least specify in the documentation that (some) JPQL functions are
not supported.

Workaround for CURRENT_TIMESTAMP is to run query with date parameter new
java.util.Date().

http://groups.google.com/group/google-appengine-java/browse_frm/thread/2748f5a9fb8a6d71
Aug 14, 2009
Project Member #1 max.r...@gmail.com
Added support for CURRENT_TIMESTAMP and CURRENT_DATE.  CURRENT_TIME is not possible
right now since there is no native type for Time.  Please file a separate issue for
this if it's important to you.
Status: Fixed
Labels: TargetRelease-1.0.3
Aug 21, 2009
Project Member #2 max.r...@gmail.com
(No comment was entered for this change.)
Summary: JPA support for JPQL functions CURRENT_TIMESTAMP, CURRENT_DATE
Sep 12, 2009
#3 srinivas...@gmail.com
when i am executing the query:-

Query query = pm.newQuery(test.TestClass.class);
query.declareParameters("int theYear");
query.setFilter("date.getDay() == theYear");
List results = (List)query.execute(new Integer(12));
Iterator iter = results.iterator();

iam getting the following Exception:


org.datanucleus.store.appengine.query.DatastoreQuery$UnsupportedDatastoreFeatureException:
Problem with query <SELECT FROM test.TestClass WHERE date.getDay() == theYear
PARAMETERS int theYear>: Unsupported method <getDay> while parsing expression:
InvokeExpression{[PrimaryExpression{date}].getDay(<none>)}


please help me if u r aware of this.
Nov 6, 2009
Project Member #4 max.r...@gmail.com
(No comment was entered for this change.)
Status: Verified
Sign in to add a comment

Powered by Google Project Hosting