[
https://issues.apache.org/jira/browse/OPENJPA-3049?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maxim Solodovnik resolved OPENJPA-3049.
---------------------------------------
Fix Version/s: 4.2.0
Assignee: Richard Zowalla
Resolution: Fixed
> 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
> Assignee: Richard Zowalla
> Priority: Major
> Fix For: 4.2.0
>
>
> 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)