Bad SQL génération with Criteria class and complex operand #1938
Labels
status: waiting-for-feedback
We need additional information before we can continue
status: waiting-for-triage
An issue we've not yet triaged
Hello,
I am having some trouble when generating queries with the Criteria class (org.springframework.data.relational.core.query)
It's seems not possible to make a query like :
(a OR b) AND c
=> This will be generated asa OR b AND c
: it's not the same result.I have defined the following method to generate an OR's combination :
And for the AND combination :
Doing this, I'm expecting to have an OR combination inside a AND combination rounded with parenthesis in the generated query. It's not the case, when the OR combination is the first operand of the AND combination.
To solve the problem, I have to ensure the OR sub criteria is not placed at the first position of a AND criteria : it can't be used in a generic engine...
Is this API still maintained ?
Is there any workaround to permit the use of this API in any OR / AND combination ?
Thank you.
The text was updated successfully, but these errors were encountered: