Richard Zowalla created OPENJPA-3049:
----------------------------------------

             Summary: 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


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)

Reply via email to