today I migrated to EclipseLink 2.4.0-RC2 and all my queries stopped working.
After investigating the issue, I found out that some of the conditions in my JPQL queries are not generating the correct SQL.
Here is a simplified example.
I have the following JPQL conditions:
(NOT( 1 = :free) OR v.price = 0)
NOT(1 = :blockUnrated) OR
Using EclipseLink 2.3.1 I get the following SQL conditions:
(Not ((1 = ?)) Or (T0.Price = ?))
With EclipseLink 2.4.0 the SQL is wrong:
NOT (((1 = ?) OR (t0.PRICE = ?)))
NOT (((1 = 0) OR (....)))
As you can see in 2.4.0 the whole internal statement (OR) is inverted. Since NOT is a unary operator, it has a higher priority than anything else.
I am not sure if I'm wrong or this is a real bug. But in any case there's a big difference in behavior between 2.3.1 and 2.4.0.
It will be great if someone can test this and see if this is a real issue.