[ 
https://issues.apache.org/jira/browse/OPENJPA-3044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134691#comment-18134691
 ] 

ASF subversion and git services commented on OPENJPA-3044:
----------------------------------------------------------

Commit 4f2c174922b7a363955fc24ebac311109b5bf4c5 in openjpa's branch 
refs/heads/asciidoc from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=4f2c17492 ]

[OPENJPA-3044] Accept a sign in front of an arithmetic primary in JPQL (#244)

* [OPENJPA-3044] Accept a sign in front of an arithmetic primary in JPQL

* [OPENJPA-3044] Keep the type of the bound value for a negated input parameter

* [OPENJPA-3044] Use pattern matching for the math check

* [OPENJPA-3044] minor code clean-up

---------

Co-authored-by: Maxim Solodovnik <[email protected]>

> JPQL does not accept a sign in front of a path, e.g. SELECT -n.intA
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-3044
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3044
>             Project: OpenJPA
>          Issue Type: Sub-task
>            Reporter: Richard Zowalla
>            Assignee: Richard Zowalla
>            Priority: Major
>             Fix For: 4.2.0
>
>
> JPQL does not accept a sign in front of a path or other arithmetic primary:
> {code}
> SELECT -n.intA FROM NumericOperands n
> {code}
> fails to parse. The JPQL grammar ({{JPQL.jjt}}) only allows a sign on numeric 
> literals ({{negative()}}); {{arithmetic_factor}} has no optional sign. The 
> Jakarta Persistence BNF defines {{arithmetic_factor ::= [{+ | -}] 
> arithmetic_primary}}, so {{-n.intA}}, {{-(n.a + n.b)}} and {{+n.intA}} should 
> be valid. The criteria API ({{cb.neg(x)}}) works.
> Found while working on OPENJPA-3035.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to