Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NOT operator is not handled properly in EclipseLink 2.4.0(NOT operator has wrong priority in 2.4.0)
NOT operator is not handled properly in EclipseLink 2.4.0 [message #885707] Wed, 13 June 2012 13:13 Go to next message
Nikolay Alexiev is currently offline Nikolay AlexievFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,

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


(Not ((1 = ?)) Or ...)


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.
Re: NOT operator is not handled properly in EclipseLink 2.4.0 [message #889714 is a reply to message #885707] Tue, 19 June 2012 13:57 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Please log a bug for this issue and vote for it.

You can revert 2.4 to the old JPQL parser using the persistence unit property,

"eclipselink.jpql.parser"="ANTLR"


James : Wiki : Book : Blog : Twitter
Re: NOT operator is not handled properly in EclipseLink 2.4.0 [message #895545 is a reply to message #889714] Fri, 13 July 2012 13:49 Go to previous message
Pascal Filion is currently offline Pascal FilionFriend
Messages: 5
Registered: July 2009
Location: Raleigh, NC
Junior Member
It will be fixed in EclipseLink 2.4.1
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385056
Previous Topic:EclipseLink/Moxy 2.4 - some objects not marshalled after correct unmarshalling of XML
Next Topic:Multitenant Shared Data
Goto Forum:
  


Current Time: Wed Apr 24 20:09:26 GMT 2024

Powered by FUDForum. Page generated in 0.03645 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top