[
https://issues.apache.org/jira/browse/OPENJPA-3049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139119#comment-18139119
]
ASF subversion and git services commented on OPENJPA-3049:
----------------------------------------------------------
Commit 97b3ffd8a98ef310e9d790bb506577438e137bd2 in openjpa's branch
refs/heads/OPENJPA-3049 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=97b3ffd8a ]
[OPENJPA-3049] Rank Double and Float above BigDecimal and BigInteger in the
result type of JPQL arithmetic
> 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)