glassfish
  1. glassfish
  2. GLASSFISH-310

EJBQL: constructor query with aggregate argument runs into NPE

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.0pe_dev
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      310

      Description

      This issue was reported on the forum:
      http://forums.java.net/jive/thread.jspa?threadID=13384&tstart=0

      An EJBQL query using an aggregate function as an argument of a constructor
      expression runs into a NullPointerException in ReportQuery.buildObject at
      runtime. Here is the sample query:
      SELECT NEW custom.CityCount(c.city, COUNT(c)) FROM Customer c GROUP BY c.city
      The forum post includes the stacktrace of the NPE.

        Activity

        Hide
        mb124283 added a comment -

        Started looking into this.

        Michael

        Show
        mb124283 added a comment - Started looking into this. Michael
        Hide
        mb124283 added a comment -

        Fixed the NPE in the EJB QL compiler ConstructorNode parse tree implementation.
        It now uses the ReportQuery API taking Class instances for the constructor
        arguments instead of mappings.

        Show
        mb124283 added a comment - Fixed the NPE in the EJB QL compiler ConstructorNode parse tree implementation. It now uses the ReportQuery API taking Class instances for the constructor arguments instead of mappings.

          People

          • Assignee:
            mb124283
            Reporter:
            mb124283
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: