Query generated by OpenJPA does not have enough parentheses

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Query generated by OpenJPA does not have enough parentheses

pasamy
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) = ?))

Is there any workaround for this?


Loading...