MountainClimb / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

Support aggregate queries with result class #256

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If the user executes a query like

SELECT COUNT(b) FROM Book b

and provides a result class of Long, then an error will result
javax.persistence.PersistenceException: Result class is simple, but field value 
[Ljava.lang.Object;@6e119d not convertible into that

The real problem is that COUNT is only handled in DatastoreQuery currently, 
manually counting the number of entities.

Original issue reported on code.google.com by googleco...@yahoo.co.uk on 1 Nov 2011 at 2:30

GoogleCodeExporter commented 8 years ago
Test present in SVN trunk, under tests_bugs.

Original comment by googleco...@yahoo.co.uk on 1 Nov 2011 at 2:42

GoogleCodeExporter commented 8 years ago
SVN trunk passes on this since it will evaluate result/resultClass in-memory on 
the candidates pulled from the datastore.

Original comment by googleco...@yahoo.co.uk on 22 Feb 2012 at 9:04