forrestzhu / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

filter not followed by BoolParenExpression broken #86

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Access a URI such as 
Products?$filter=not (Discontinued eq 1 or UnitsOnOrder le 70)
See attached QueryOptionTest.java, method 
SystemQueryOptionFilterLogicalNotTest2.

What is the expected output? What do you see instead?
Expected output for the test case is a JSON result.

Instead, we get an exception.
Caused by: Exception [EclipseLink-8024] (Eclipse Persistence Services - 
2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing the query [SELECT t0 FROM Products 
t0 WHERE NOT ((t0.Discontinued = 1 OR t0.UnitsOnOrder <= 70) = TRUE)], line 1, 
column 85: syntax error at [=].

What version of the product are you using? On what operating system?
0.5 snapshot from October 26.

Please provide any additional information below.
I've attached a fix for this problem.  See JPQLGenerator.java method 
toJpql(BoolCommonExpression).

Original issue reported on code.google.com by slvjer...@gmail.com on 1 Nov 2011 at 2:32

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by john.spurlock on 5 Nov 2011 at 6:48

GoogleCodeExporter commented 8 years ago
Thanks for reporting and providing the fix+test!

Original comment by john.spurlock on 5 Nov 2011 at 7:11