Problem with mapped type Integer in Number column #7518
Closed
ederfmatos-exacta
started this conversation in
Design Proposals
Replies: 1 comment
-
This has already been discussed and we will not change it. Hibernate needs to be able to correctly reverse-engineer types from the DDL it generates. If you are using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a column in an Oracle database, version 19, defined as number(10). This allows for values up to a certain limit, 2,147,483,647. In practice, when a query is executed where the column value exceeds the maximum limit for an integer type, an error occurs. Within the code, I found the segment that designates the integer type and an accompanying comment stating that using the integer type is safe. However, this has not been my experience, as the integer type in Java has a maximum value of 2,147,483,647. Given that there's a significant chance of exceeding this limit, it seems that the number(10) definition might not be appropriate and that larger values might be anticipated. Indeed, in cases where a number(10) exceeds the integer range, errors can arise. In my situation, casting the column to a larger numeric type resolved the issue. It would be beneficial for this to be the default behavior to prevent such errors, especially in integration with Hibernate where type mappings are crucial.
hibernate-orm/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java
Line 820 in 4087774
Beta Was this translation helpful? Give feedback.
All reactions