Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0RC2
-
None
Description
Test case to cause the error:
ObjectContext context = createDataContext();
Expression exp = ExpressionFactory.matchExp(Painting.TO_GALLERY_PROPERTY, null);
EJBQLQuery query = new EJBQLQuery("select count(p), p.toArtist from Painting p where " + exp.toEJBQL("p") + " group by p.toArtist");
context.performQuery(query);
From the test I get this message:
java.sql.SQLException: Not in aggregate function or group by clause: org.hsqldb.Expression@83b18f in statement [SELECT COUNT(*) AS sc0, t1.ARTIST_ID AS ec1_2, t1.ARTIST_NAME AS ec1_1, t1.DATE_OF_BIRTH AS ec1_0 FROM PAINTING t0 LEFT OUTER JOIN ARTIST t1 ON (t0.ARTIST_ID = t1.ARTIST_ID) GROUP BY t0.ARTIST_ID]