glassfish
  1. glassfish
  2. GLASSFISH-2220

Should add support for native queries reading into non-entity objects

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 9.1pe
    • Fix Version/s: not determined
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      2,220

      Description

      It would be really nice if you could pass in a non-entity class to
      a native query. It would be equivalent to a SELECT INTO in JP QL.

      For example, EmployeeAccount is not an entity class:

      List list = em.createNativeQuery("SELECT * FROM EMP_ACCT",
      EmployeeAccount.class)
      .getResultList();
      List<EmployeeAccount> empAcctList = (List<EmployeeAccount>) list;

      The same proviso would be in effect as with the JP QL SELECT INTO clause, which
      is that there must be a constructor for the given class that takes the same
      number and types of arguments as returned for each returned tuple.

        Activity

        Hide
        Tom Mueller added a comment -

        Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.

        Show
        Tom Mueller added a comment - Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.

          People

          • Assignee:
            tware
            Reporter:
            mkeith
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: