You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "George Hongell (JIRA)" <ji...@apache.org> on 2006/09/20 00:56:22 UTC

[jira] Commented: (OPENJPA-47) 143 arithmetic unary operator (+,-) gives parsing error

    [ http://issues.apache.org/jira/browse/OPENJPA-47?page=comments#action_12436044 ] 
            
George Hongell commented on OPENJPA-47:
---------------------------------------

removed testcase references.
EJBQL:
select e from EmpBean e where -(e.salary+10) > -10 

OPENJPA ERROR OR SQL PUSHDOWN:

An error occurred while parsing the query filter 'select e from EmpBean e where -(e.salary+10) > -10'. Error message: <4|false|0.0.0> org.apache.openjpa.kernel.jpql.ParseException: Encountered "- (" at character 31, but expected: ["(", "+", "-", ":", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", <BOOLEAN_LITERAL>, <DECIMAL_LITERAL>, <IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>]. 


> 143 arithmetic unary operator (+,-) gives parsing error
> -------------------------------------------------------
>
>                 Key: OPENJPA-47
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-47
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>         Environment: windows xp, derby, db2 
>            Reporter: George Hongell
>
> 143 unary operator (+,-) gives parsing error
> select e from EmpBean e where -(e.salary) >-10;
> select e from EmpBean e where -e.salary >-10;
> select e, -e.salary , +e.salary  from EmpBean e where +e.salary >-10;
>   [ FAILED 143- bucket = fvtfull, query = select e from EmpBean e where -(e.salary+10) > -10  : 
>    DIFFERENCE-locations based on expected-(
> diff at line 2 position 1 EXPECTED [[]  ACTUAL [ ] 
> [( class com.dw.test.EmpBean  empid=2 name=andrew salary=13.1 dept=210)]
>                                                                                                                                                                                                                                                                                                                                                                                                                                                    e                                                                                                                                                                                                                                                                                                                                                                                                                                                     
> ) 
>    EXPECTED(
>  TEST143; select e from EmpBean e where -(e.salary+10) > -10 
> [( class com.dw.test.EmpBean  empid=2 name=andrew salary=13.1 dept=210)]
> [( class com.dw.test.EmpBean  empid=4 name=george salary=0.0 dept=200)]
> [( class com.dw.test.EmpBean  empid=1 name=david salary=12.1 dept=210)]
> [( class com.dw.test.EmpBean  empid=10 name=Catalina Wei salary=0.0 dept=0)]
> [( class com.dw.test.EmpBean  empid=3 name=minmei salary=15.5 dept=200)]
> [( class com.dw.test.EmpBean  empid=5 name=ritika salary=0.0 dept=220)]
> [( class com.dw.test.EmpBean  empid=6 name=ahmad salary=0.0 dept=100)]
> [( class com.dw.test.EmpBean  empid=7 name=charlene salary=0.0 dept=210)]
> [( class com.dw.test.EmpBean  empid=8 name=Tom Rayburn salary=0.0 dept=100)]
> [( class com.dw.test.EmpBean  empid=9 name=harry salary=0.0 dept=210)]
>  TEST143; 10 tuples) 
>    ACTUAL(
>  TEST143; select e from EmpBean e where -(e.salary+10) > -10 
>                                                                                                                                                                                                                                                                                                                                                                                                                                                    e                                                                                                                                                                                                                                                                                                                                                                                                                                                     
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
> An error occurred while parsing the query filter 'select e from EmpBean e where -(e.salary+10) > -10'. Error message: <4|false|0.0.0> org.apache.openjpa.kernel.jpql.ParseException: Encountered "- (" at character 31, but expected: ["(", "+", "-", ":", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", <BOOLEAN_LITERAL>, <DECIMAL_LITERAL>, <IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>]. 
>  TEST143; 1 tuple) ]

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira