[ 
https://issues.apache.org/jira/browse/OPENJPA-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-2692.
--------------------------------------
    Resolution: Won't Fix

Closing as obsolete during backlog cleanup: Not a defect: the generated `A AND 
B AND C AND D OR E AND F AND G AND H` is equivalent to the JPQL because AND 
binds tighter than OR. Please reopen if this still happens with OpenJPA 4.x.

> Generated query does not have enough parentheses
> ------------------------------------------------
>
>                 Key: OPENJPA-2692
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2692
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: Palani G
>            Priority: Blocker
>
> 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) = ?))



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to