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

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

Commit 198aa1ab460731f4955c419d4e60ce9d14c9e812 in openjpa's branch 
refs/heads/master from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=198aa1ab4 ]

[OPENJPA-3049] Rank Double and Float above BigDecimal and BigInteger in the 
result type of JPQL arithmetic (#275)

> JPQL arithmetic ranks BigDecimal above Double, unlike the numeric promotion 
> of the specification
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-3049
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3049
>             Project: OpenJPA
>          Issue Type: Sub-task
>            Reporter: Richard Zowalla
>            Priority: Major
>
> JPQL arithmetic takes its result type from {{Filters.promote}}, which returns 
> BigDecimal when either operand is BigDecimal. The specification promotes 
> BigDecimal with Double or Float to Double or Float. Since OPENJPA-3035 the 
> criteria API follows the specification, so the same query written in JPQL and 
> with the criteria API can return different Java types.
> Changing it in JPQL also affects decimal literals, which JPQL parses as 
> BigDecimal, so {{n.floatField * 1.5}} would become a Float. The migration 
> notes of 4.2 mention the difference.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
  • [jira] [Commented] (OPENJPA... ASF subversion and git services (Jira) via dev

Reply via email to