[
https://issues.apache.org/jira/browse/OPENJPA-3058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136953#comment-18136953
]
ASF subversion and git services commented on OPENJPA-3058:
----------------------------------------------------------
Commit ca5faeee4c853e6335e51704958448e5910546d5 in openjpa's branch
refs/heads/master from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=ca5faeee4 ]
[OPENJPA-3058] Map BigInteger to NUMERIC on H2 in the getJDBCType overload used
by column mapping (#258)
> 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)