-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: Model
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Summary
A @GeneratedValue identifier of type BigInteger or BigDecimal is rejected at boot. The supported identifier types are Short, Integer and Long.
Cause
Hibernate ORM reads the allocated value positionally from the result set and picks the accessor from the identifier's Java type. Long, Integer and Short route to ResultSet#getLong; BigInteger and BigDecimal route to ResultSet#getBigDecimal. The counter document stores the value as a BSON 64-bit integer, while MongoResultSet#getBigDecimal accepts only BSON Decimal128, so the read fails.
The limitation is in that conversion, not in MQL.
Scope
Choose one of: store the counter as Decimal128 for these identifier types, or widen MongoResultSet#getBigDecimal to accept 64-bit integers. Implement it and remove the boot-time rejection.
Acceptance
An entity with a BigInteger identifier and one with a BigDecimal identifier each persist and reload with generated identifiers.