Skip to content

[OPENJPA-3058] Map BigInteger to NUMERIC on H2 - #258

Merged
solomax merged 1 commit into
masterfrom
OPENJPA-3058
Nov 3, 2026
Merged

solomax merged 1 commit into
masterfrom
OPENJPA-3058

Conversation

@rzo1

@rzo1 rzo1 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/OPENJPA-3058

On H2 a BigInteger attribute got a BIGINT column, so values with more than 19 digits failed with "Numeric value out of range". H2Dictionary mapped BigInteger to NUMERIC only in getJDBCType(int, boolean), but column mapping calls the overload with precision and scale, so the DDL never used it.

  • The mapping moves to getJDBCType(int, boolean, int, int), which all overloads go through, so DDL and casts agree.
  • StoreLargeNumbersAsStrings and other dictionaries are unchanged.
  • Migration note: new H2 tables get NUMERIC, existing BIGINT columns keep working.

New TestH2BigIntegerType and TestBigIntegerMapping (30-digit value as field, primary key, foreign key and query parameter). Merges cleanly with #256. Full suites pass on Derby and H2.

@rzo1 rzo1 self-assigned this Nov 2, 2026
@rzo1
rzo1 requested review from cristof and solomax November 2, 2026 20:04
@solomax
solomax merged commit ca5faee into master Nov 3, 2026
4 checks passed
@solomax
solomax deleted the OPENJPA-3058 branch November 3, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants