OpenJPA
  1. OpenJPA
  2. OPENJPA-2008

OpenJPA does not work with native queries in a distributed (Slice) environment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: slice
    • Labels:
      None
    • Environment:
      Slice, Tomcat 6, MySql 5.5, openJPA 2.1

      Description

      When trying to create a native query in a distributed (slice) environment, an exception is thrown because there is no ExpressionParser for language openJPA.SQL for a distributed query.

        Activity

        David Louie created issue -
        Hide
        David Louie added a comment -

        Issue has been resolved in revision 1135806.

        Tested with the following query and the query worked, count works, and sorting works:

        SELECT DISTINCT u.uid, u.studentid, u.firstname, u.lastname, u.username, u.lastlogintime, count(DISTINCT e.uid) FROM roles r
        INNER JOIN userroles ur ON ur.roleID = r.uid
        INNER JOIN users u ON ur.userID = u.uid
        AND r.namefield IN (?1)
        AND u.lastname LIKE ?2
        AND u.firstname LIKE ?3
        AND u.studentid LIKE ?4
        AND u.isactive IS TRUE
        LEFT JOIN courseenrollments e ON e.userID = u.uid
        AND e.schoolyearID = ?5
        AND e.enddate IS NULL
        GROUP BY u.uid, u.studentid, u.firstname, u.lastname, u.username, u.lastlogintime
        ORDER BY u.uid

        Show
        David Louie added a comment - Issue has been resolved in revision 1135806. Tested with the following query and the query worked, count works, and sorting works: SELECT DISTINCT u.uid, u.studentid, u.firstname, u.lastname, u.username, u.lastlogintime, count(DISTINCT e.uid) FROM roles r INNER JOIN userroles ur ON ur.roleID = r.uid INNER JOIN users u ON ur.userID = u.uid AND r.namefield IN (?1) AND u.lastname LIKE ?2 AND u.firstname LIKE ?3 AND u.studentid LIKE ?4 AND u.isactive IS TRUE LEFT JOIN courseenrollments e ON e.userID = u.uid AND e.schoolyearID = ?5 AND e.enddate IS NULL GROUP BY u.uid, u.studentid, u.firstname, u.lastname, u.username, u.lastlogintime ORDER BY u.uid
        David Louie made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2.0 [ 12315910 ]
        Resolution Fixed [ 1 ]
        Pinaki Poddar made changes -
        Assignee Pinaki Poddar [ ppoddar@apache.org ]
        Hide
        Albert Lee added a comment -

        Close issue in preparation for 2.2.0 release.

        Show
        Albert Lee added a comment - Close issue in preparation for 2.2.0 release.
        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            David Louie
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development