Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1367

EJBQL: Implement support for relationship-ending paths in GROUP BY clause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0RC2
    • 3.0RC2
    • Core Library
    • 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]

      Attachments

        1. 0001-CAY-1367.patch
          16 kB
          Ksenia Khailenko
        2. count-error-fix.patch
          4 kB
          Ksenia Khailenko
        3. fix-big-decimal.patch
          2 kB
          Ksenia Khailenko

        Activity

          People

            andrus Andrus Adamchik
            shentalus Dave Dombrosky
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: