Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2692

Generated query does not have enough parentheses

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • 2.4.0
    • None
    • None
    • None

    Description

      Here is the JPQL
      SELECT process FROM com.aa.bb.Process process WHERE ((((process._server._id = :server_id and UPPER(process._processId) = :processId) and UPPER(process._processName) = :processName) and UPPER(process._origNode) = :origNode) or (((process._server._id = :server_id2 and UPPER(process._processId) = :processId2) and UPPER(process._processName) = :processName2) and UPPER(process._origNode) = :origNode2))]

      Incorrect query generated openJPA

      --> [SELECT t0.PROCESS_ID, t0.ORIG_NODE, t0.PROC_ID, t0.PROC_NAME, FROM PROCESS_TABLE t0 WHERE (t0.SERVER_ID = ? AND UPPER(t0.PROC_ID) = ? AND UPPER(t0.PROC_NAME) = ? AND UPPER(t0.ORIG_NODE) = ? OR t0.SERVER_ID = ? AND UPPER(t0.PROC_ID) = ? AND UPPER(t0.PROC_NAME) = ? AND UPPER(t0.ORIG_NODE) = ?)]

      This should be the correct query generated by openjpa

      SELECT t0.PROCESS_ID, t0.ORIG_NODE, t0.PROC_ID, t0.PROC_NAME, FROM PROCESS_TABLE t0 WHERE
      ( (t0.SERVER_ID = ? AND UPPER(t0.PROC_ID) = ? AND UPPER(t0.PROC_NAME) = ? AND UPPER(t0.ORIG_NODE) = ? ) OR (t0.SERVER_ID = ? AND UPPER(t0.PROC_ID) = ? AND UPPER(t0.PROC_NAME) = ? AND UPPER(t0.ORIG_NODE) = ?))

      Attachments

        Activity

          People

            Unassigned Unassigned
            pasamy Palani G
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: