Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0.2
-
None
Description
I have a entity which have a field scannedDate, create a repository with method findByXXX() which return a QueryResult.
If I call QueryResult.orderAsc("scannedDate").count(), this error will happen.
ERROR: column "t0.scanneddate" must appear in the GROUP BY clause or be used in an aggregate function
I use openjpa 2.2, We cannot simply remove the "order by", Because if we order by a attribute of associated entity like order by e.foo.bar, JPA engine will generate a inner join, if we simply remove the "order by" the count result will not correct.
Maybe this is not a bug, just a limitation.