From 1b2107e7b476b033266cad9fa022ed566da6b14c Mon Sep 17 00:00:00 2001 From: Gavin Date: Thu, 6 Apr 2023 10:56:19 +0200 Subject: [PATCH] make a code comment even clearer b/c apparently some don't get it --- .../java/org/hibernate/dialect/OracleDialect.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java index 088a0b609d..a22e361ff3 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java @@ -737,11 +737,14 @@ public class OracleDialect extends Dialect { // range of values of a NUMBER(3,0) or NUMBER(5,0) just // doesn't really match naturally. if ( precision <= 10 ) { - // A NUMBER(10,0) might not fit in a 32-bit integer, + // We map INTEGER to NUMBER(10,0), so we should also + // map NUMBER(10,0) back to INTEGER. (In principle, + // a NUMBER(10,0) might not fit in a 32-bit integer, // but it's still pretty safe to use INTEGER here, - // since we can assume the most likely reason to find - // a column of type NUMBER(10,0) in an Oracle database - // is that it's intended to store an integer. + // since we can safely assume that the most likely + // reason to find a column of type NUMBER(10,0) in + // an Oracle database is that it's intended to store + // an integer.) return jdbcTypeRegistry.getDescriptor( INTEGER ); } else if ( precision <= 19 ) {