rzo1 opened a new pull request, #244:
URL: https://github.com/apache/openjpa/pull/244

   https://issues.apache.org/jira/browse/OPENJPA-3044
   
   JPQL accepted a sign only on numeric literals, so `SELECT -n.intA` did not 
parse. The Jakarta Persistence BNF has `arithmetic_factor ::= [{+ | -}] 
arithmetic_primary`.
   
   - `JPQL.jjt`: `arithmetic_factor` takes an optional sign in front of any 
arithmetic primary (path, parenthesised expression, parameter, function, 
aggregate, CASE, subquery). A sign on a number literal is still part of the 
literal, so `-1`, `1 - -1` and `a -1` parse as before; no new JavaCC conflicts.
   - Unary minus is built as `0 - x` and keeps the operand's type.
   - `-:p`: the parameter has no type at compile time, so the type of the bound 
value is now used for the Derby cast, the loaded result and in-memory 
evaluation, and such queries stay out of the SQL cache (otherwise a rerun with 
another type reuses the old cast).
   
   New tests in `TestJPQLParser` and `TestUnarySign` (SELECT, WHERE, ORDER BY, 
HAVING, parameters of each numeric type, in memory). Full suite passes on Derby 
and H2.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to