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

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

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

[OPENJPA-3051] Keep the precision and scale of decimal columns on H2 (#256)

* [OPENJPA-3051] Keep the precision and scale of decimal columns on H2

H2 2.x reads an unsized NUMERIC as NUMERIC(100000, 0). H2Dictionary
listed NUMERIC and DECIMAL as fixed size types, so @Column(precision,
scale) was dropped from the DDL and fractional values were rounded to
integers. Write the precision and scale into the type name and create
an unsized decimal column of a non integral Java type as DECFLOAT(38)
on H2 2.x, unless NumericTypeName or DecimalTypeName was configured.
Read a DECFLOAT value with negative scale back with scale 0. Use
fractional decimals in the OPENJPA-3035 and OPENJPA-3044 tests.

* [OPENJPA-3051] indentation

---------

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

> MySQL: numeric operations return Long where Integer is expected
> ---------------------------------------------------------------
>
>                 Key: OPENJPA-3035
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3035
>             Project: OpenJPA
>          Issue Type: Sub-task
>            Reporter: Richard Zowalla
>            Priority: Major
>             Fix For: 4.2.0
>
>
> On MySQL, arithmetic on integer attributes returns a {{Long}}:
> {noformat}ClassCastException: class java.lang.Long cannot be cast to class 
> java.lang.Integer{noformat}
> The JPA spec gives the result type of these operations from the operand 
> types, so the value has to be converted to the expected type.
> Failing tests: {{Client5.diffNumberExpTest}}, {{neg}}, {{sumNumExpTest}}.



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

Reply via email to