[
https://issues.apache.org/jira/browse/OPENJPA-3058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maxim Solodovnik resolved OPENJPA-3058.
---------------------------------------
Resolution: Fixed
> H2: a BigInteger column is created as BIGINT
> --------------------------------------------
>
> Key: OPENJPA-3058
> URL: https://issues.apache.org/jira/browse/OPENJPA-3058
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Reporter: Richard Zowalla
> Assignee: Richard Zowalla
> Priority: Major
> Fix For: 4.2.0
>
>
> On H2, a {{BigInteger}} attribute gets a {{BIGINT}} column, so a value with
> more than 19 digits fails with "Numeric value out of range".
> {{H2Dictionary}} overrides {{getJDBCType(int, boolean)}} to map
> {{JavaTypes.BIGINTEGER}} to {{Types.NUMERIC}}, but column mapping calls the
> overloads with precision and scale ({{getJDBCType(int, boolean, int, int[,
> boolean])}}), which do not go through the two-argument method. The override
> is therefore never used during mapping and the base mapping to {{BIGINT}}
> applies.
> The override should move to the overload that mapping uses, and the column
> should be a {{NUMERIC}} with enough precision for the value (H2 2.x reads a
> plain {{NUMERIC}} as {{NUMERIC(100000, 0)}}, see OPENJPA-3051).
> Found while working on OPENJPA-3051.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)