From 7aeb03beea7b3faa474dc1921a2d7adce3ee5d22 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Mon, 26 Jul 2021 16:00:03 +0200 Subject: [PATCH] remove older getJdbcType() method --- .../mapping/basic/CustomBinaryJdbcType.java | 2 +- .../dialect/AbstractHANADialect.java | 4 +-- .../function/TimestampaddFunction.java | 2 +- .../internal/FunctionReturnImpl.java | 2 +- .../org/hibernate/type/PostgresUUIDType.java | 2 +- .../type/StandardBasicTypeTemplate.java | 2 +- ...uteConverterJdbcTypeDescriptorAdapter.java | 4 +-- .../descriptor/jdbc/BigIntTypeDescriptor.java | 2 +- .../descriptor/jdbc/BinaryTypeDescriptor.java | 2 +- .../descriptor/jdbc/BlobTypeDescriptor.java | 2 +- .../jdbc/BooleanTypeDescriptor.java | 2 +- .../descriptor/jdbc/CharTypeDescriptor.java | 2 +- .../descriptor/jdbc/ClobTypeDescriptor.java | 2 +- .../descriptor/jdbc/DateTypeDescriptor.java | 2 +- .../jdbc/DecimalTypeDescriptor.java | 2 +- .../descriptor/jdbc/DoubleTypeDescriptor.java | 2 +- .../descriptor/jdbc/FloatTypeDescriptor.java | 2 +- .../jdbc/IntegerTypeDescriptor.java | 2 +- .../descriptor/jdbc/JdbcTypeDescriptor.java | 29 ++++++++----------- .../jdbc/LongNVarcharTypeDescriptor.java | 2 +- .../jdbc/LongVarbinaryTypeDescriptor.java | 2 +- .../jdbc/LongVarcharTypeDescriptor.java | 2 +- .../descriptor/jdbc/NCharTypeDescriptor.java | 2 +- .../descriptor/jdbc/NClobTypeDescriptor.java | 2 +- .../jdbc/NVarcharTypeDescriptor.java | 2 +- .../jdbc/NumericTypeDescriptor.java | 2 +- .../jdbc/ObjectJdbcTypeDescriptor.java | 2 +- .../descriptor/jdbc/RealTypeDescriptor.java | 2 +- .../jdbc/SmallIntTypeDescriptor.java | 2 +- .../descriptor/jdbc/TimeTypeDescriptor.java | 2 +- .../jdbc/TimestampTypeDescriptor.java | 2 +- .../jdbc/TimestampWithTimeZoneDescriptor.java | 2 +- .../jdbc/TinyIntTypeDescriptor.java | 2 +- .../jdbc/VarbinaryTypeDescriptor.java | 2 +- .../jdbc/VarcharTypeDescriptor.java | 2 +- .../type/internal/UserTypeSqlTypeAdapter.java | 2 +- ...ativeQueryResultTypeAutoDiscoveryTest.java | 2 +- .../annotations/basics/sql/JdbcTypeTests.java | 2 +- .../converter/AttributeConverterTest.java | 2 +- .../custom/CustomTypeConverterTest.java | 2 +- .../custom/MyCustomJdbcTypeDescriptor.java | 6 ++-- .../QueryParametersValidationArrayTest.java | 2 +- .../orm/test/sql/ast/SmokeTests.java | 2 +- .../usertype/inet/InetJdbcTypeDescriptor.java | 2 +- .../usertype/json/JsonJdbcTypeDescriptor.java | 2 +- 45 files changed, 60 insertions(+), 65 deletions(-) diff --git a/documentation/src/test/java/org/hibernate/userguide/mapping/basic/CustomBinaryJdbcType.java b/documentation/src/test/java/org/hibernate/userguide/mapping/basic/CustomBinaryJdbcType.java index a54fb324d6..5aa4c373f3 100644 --- a/documentation/src/test/java/org/hibernate/userguide/mapping/basic/CustomBinaryJdbcType.java +++ b/documentation/src/test/java/org/hibernate/userguide/mapping/basic/CustomBinaryJdbcType.java @@ -21,7 +21,7 @@ import org.hibernate.type.descriptor.jdbc.VarbinaryTypeDescriptor; */ public class CustomBinaryJdbcType implements JdbcTypeDescriptor { @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.VARBINARY; } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java index e25762a0ec..c3060b0cb7 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java @@ -298,7 +298,7 @@ public abstract class AbstractHANADialect extends Dialect { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.BLOB; } @@ -583,7 +583,7 @@ public abstract class AbstractHANADialect extends Dialect { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.BLOB; } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampaddFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampaddFunction.java index f431992218..bd3f72e6ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampaddFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampaddFunction.java @@ -69,7 +69,7 @@ public class TimestampaddFunction else { final Expression magnitude = (Expression) arguments.get( 1 ); final JdbcMapping magnitudeJdbcMapping = magnitude.getExpressionType().getJdbcMappings().get( 0 ); - switch ( magnitudeJdbcMapping.getJdbcTypeDescriptor().getJdbcType() ) { + switch ( magnitudeJdbcMapping.getJdbcTypeDescriptor().getJdbcTypeCode() ) { case Types.INTEGER: case Types.TINYINT: case Types.SMALLINT: diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/internal/FunctionReturnImpl.java b/hibernate-core/src/main/java/org/hibernate/procedure/internal/FunctionReturnImpl.java index 1e4d2e6a54..5338d87532 100644 --- a/hibernate-core/src/main/java/org/hibernate/procedure/internal/FunctionReturnImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/procedure/internal/FunctionReturnImpl.java @@ -32,7 +32,7 @@ public class FunctionReturnImpl implements FunctionReturnImplementor { public FunctionReturnImpl(ProcedureCallImplementor procedureCall, AllowableOutputParameterType ormType) { this.procedureCall = procedureCall; - this.jdbcTypeCode = ormType.getJdbcTypeDescriptor().getJdbcType(); + this.jdbcTypeCode = ormType.getJdbcTypeDescriptor().getJdbcTypeCode(); this.ormType = ormType; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/PostgresUUIDType.java b/hibernate-core/src/main/java/org/hibernate/type/PostgresUUIDType.java index c231a52070..d67666d5ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/PostgresUUIDType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/PostgresUUIDType.java @@ -66,7 +66,7 @@ public class PostgresUUIDType extends AbstractSingleColumnStandardBasicType extends AbstractSingleColumnStandardBa this.registrationKeys = registrationKeys; this.name = javaTypeDescriptor.getJavaType() == null ? "(map-mode)" : javaTypeDescriptor.getJavaType().getTypeName() - + " -> " + jdbcTypeDescriptor.getJdbcType(); + + " -> " + jdbcTypeDescriptor.getJdbcTypeCode(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterJdbcTypeDescriptorAdapter.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterJdbcTypeDescriptorAdapter.java index 24fd557397..556343e142 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterJdbcTypeDescriptorAdapter.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterJdbcTypeDescriptorAdapter.java @@ -51,8 +51,8 @@ public class AttributeConverterJdbcTypeDescriptorAdapter implements JdbcTypeDesc } @Override - public int getJdbcType() { - return delegate.getJdbcType(); + public int getJdbcTypeCode() { + return delegate.getJdbcTypeCode(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BigIntTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BigIntTypeDescriptor.java index f6205d56b0..5f9a106ba6 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BigIntTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BigIntTypeDescriptor.java @@ -32,7 +32,7 @@ public class BigIntTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.BIGINT; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BinaryTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BinaryTypeDescriptor.java index 86dbbf1914..5ae090b7e7 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BinaryTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BinaryTypeDescriptor.java @@ -19,7 +19,7 @@ public class BinaryTypeDescriptor extends VarbinaryTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.BINARY; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BlobTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BlobTypeDescriptor.java index 871d97c541..a54bf46b26 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BlobTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BlobTypeDescriptor.java @@ -33,7 +33,7 @@ public abstract class BlobTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.BLOB; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BooleanTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BooleanTypeDescriptor.java index 8aa170e2d0..2ce0e34c51 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BooleanTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BooleanTypeDescriptor.java @@ -31,7 +31,7 @@ public class BooleanTypeDescriptor implements JdbcTypeDescriptor { public BooleanTypeDescriptor() { } - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.BOOLEAN; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/CharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/CharTypeDescriptor.java index 56648ba64e..4dbe28644a 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/CharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/CharTypeDescriptor.java @@ -27,7 +27,7 @@ public class CharTypeDescriptor extends VarcharTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.CHAR; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ClobTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ClobTypeDescriptor.java index a7725a9d23..a739617115 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ClobTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ClobTypeDescriptor.java @@ -27,7 +27,7 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor; */ public abstract class ClobTypeDescriptor implements JdbcTypeDescriptor { @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.CLOB; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DateTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DateTypeDescriptor.java index abdc879fdb..caae8a457e 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DateTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DateTypeDescriptor.java @@ -36,7 +36,7 @@ public class DateTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.DATE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DecimalTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DecimalTypeDescriptor.java index 727e448895..c7c62093d8 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DecimalTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DecimalTypeDescriptor.java @@ -33,7 +33,7 @@ public class DecimalTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.DECIMAL; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DoubleTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DoubleTypeDescriptor.java index 32dd148324..3995258b5f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DoubleTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DoubleTypeDescriptor.java @@ -35,7 +35,7 @@ public class DoubleTypeDescriptor implements JdbcTypeDescriptor { * @return {@link Types#DOUBLE} */ @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.DOUBLE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/FloatTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/FloatTypeDescriptor.java index 82dab4341f..8910e5e452 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/FloatTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/FloatTypeDescriptor.java @@ -32,7 +32,7 @@ public class FloatTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.FLOAT; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/IntegerTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/IntegerTypeDescriptor.java index 1b9027b690..20c70ac98c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/IntegerTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/IntegerTypeDescriptor.java @@ -32,7 +32,7 @@ public class IntegerTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.INTEGER; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptor.java index 83a942c190..422af9cfdb 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptor.java @@ -33,31 +33,26 @@ public interface JdbcTypeDescriptor extends Serializable { } /** - * Return the {@linkplain java.sql.Types JDBC type-code} for the column mapped by this type. + * Return the {@linkplain java.sql.Types JDBC type code} used when interacting + * with JDBC APIs. * - * @apiNote Prefer {@link #getJdbcTypeCode} + * For example, it's used when calling {@link java.sql.PreparedStatement#setNull(int, int)}. * - * @return typeCode The JDBC type-code + * @return a JDBC type code */ - int getJdbcType(); + int getJdbcTypeCode(); /** - * Get the JDBC type code associated with this SQL type descriptor + * Get a JDBC type code that identifies the SQL column type to be used for + * schema generation. + * + * This value is passed to {@link org.hibernate.dialect.Dialect#getTypeName(int)} + * to obtain the SQL column type. * - * @see #getJdbcType - */ - default int getJdbcTypeCode() { - return getJdbcType(); - } - - /** - * Get a JDBC type code that identifies the SQL column type to be - * used for schema generation. - * - * @see #getJdbcType + * @return a JDBC type code */ default int getDefaultSqlTypeCode() { - return getJdbcType(); + return getJdbcTypeCode(); } /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongNVarcharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongNVarcharTypeDescriptor.java index 3b3b5e581c..61154351cd 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongNVarcharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongNVarcharTypeDescriptor.java @@ -25,7 +25,7 @@ public class LongNVarcharTypeDescriptor extends NVarcharTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.LONGNVARCHAR; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryTypeDescriptor.java index f065b45c64..35d92cb21c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryTypeDescriptor.java @@ -20,7 +20,7 @@ public class LongVarbinaryTypeDescriptor extends VarbinaryTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.LONGVARBINARY; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharTypeDescriptor.java index a1b6240d1e..ec252cba20 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharTypeDescriptor.java @@ -25,7 +25,7 @@ public class LongVarcharTypeDescriptor extends VarcharTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.LONGVARCHAR; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NCharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NCharTypeDescriptor.java index 305222c99c..daf4febceb 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NCharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NCharTypeDescriptor.java @@ -25,7 +25,7 @@ public class NCharTypeDescriptor extends NVarcharTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.NCHAR; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NClobTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NClobTypeDescriptor.java index f0f66931cc..597913f58b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NClobTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NClobTypeDescriptor.java @@ -27,7 +27,7 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor; */ public abstract class NClobTypeDescriptor implements JdbcTypeDescriptor { @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.NCLOB; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NVarcharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NVarcharTypeDescriptor.java index 0164c23b3b..8c6b1d897c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NVarcharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NVarcharTypeDescriptor.java @@ -32,7 +32,7 @@ public class NVarcharTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.NVARCHAR; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NumericTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NumericTypeDescriptor.java index dffe8ca3ce..329f9dc9f9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NumericTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NumericTypeDescriptor.java @@ -25,7 +25,7 @@ public class NumericTypeDescriptor extends DecimalTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.NUMERIC; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ObjectJdbcTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ObjectJdbcTypeDescriptor.java index 25f92fe706..aecc6c8d8b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ObjectJdbcTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ObjectJdbcTypeDescriptor.java @@ -35,7 +35,7 @@ public class ObjectJdbcTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return jdbcTypeCode; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/RealTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/RealTypeDescriptor.java index 32810ee880..ae7a0afb4b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/RealTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/RealTypeDescriptor.java @@ -26,7 +26,7 @@ public class RealTypeDescriptor extends FloatTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.REAL; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/SmallIntTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/SmallIntTypeDescriptor.java index d30ed4f5cc..f7774709b8 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/SmallIntTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/SmallIntTypeDescriptor.java @@ -32,7 +32,7 @@ public class SmallIntTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.SMALLINT; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimeTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimeTypeDescriptor.java index 675c613452..32b950f640 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimeTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimeTypeDescriptor.java @@ -36,7 +36,7 @@ public class TimeTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.TIME; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampTypeDescriptor.java index 164005d861..45fa1740c8 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampTypeDescriptor.java @@ -36,7 +36,7 @@ public class TimestampTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.TIMESTAMP; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampWithTimeZoneDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampWithTimeZoneDescriptor.java index f2b860f434..19e7322e43 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampWithTimeZoneDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampWithTimeZoneDescriptor.java @@ -35,7 +35,7 @@ public class TimestampWithTimeZoneDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.TIMESTAMP_WITH_TIMEZONE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TinyIntTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TinyIntTypeDescriptor.java index 2f89ff2ce9..8c703e251d 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TinyIntTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TinyIntTypeDescriptor.java @@ -35,7 +35,7 @@ public class TinyIntTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.TINYINT; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarbinaryTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarbinaryTypeDescriptor.java index c1f2f4f09b..457a029dd9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarbinaryTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarbinaryTypeDescriptor.java @@ -49,7 +49,7 @@ public class VarbinaryTypeDescriptor implements JdbcTypeDescriptor { return "VarbinaryTypeDescriptor"; } - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.VARBINARY; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarcharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarcharTypeDescriptor.java index 8f29ada350..29fea94e99 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarcharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarcharTypeDescriptor.java @@ -32,7 +32,7 @@ public class VarcharTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.VARCHAR; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/internal/UserTypeSqlTypeAdapter.java b/hibernate-core/src/main/java/org/hibernate/type/internal/UserTypeSqlTypeAdapter.java index 25f277b1fd..b3510146b8 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/internal/UserTypeSqlTypeAdapter.java +++ b/hibernate-core/src/main/java/org/hibernate/type/internal/UserTypeSqlTypeAdapter.java @@ -47,7 +47,7 @@ public class UserTypeSqlTypeAdapter implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return userType.sqlTypes()[0]; } diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/query/NativeQueryResultTypeAutoDiscoveryTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/query/NativeQueryResultTypeAutoDiscoveryTest.java index 246bb5ac92..b87246d9ff 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/query/NativeQueryResultTypeAutoDiscoveryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/query/NativeQueryResultTypeAutoDiscoveryTest.java @@ -616,7 +616,7 @@ class BitTypeDescriptor implements JdbcTypeDescriptor { public BitTypeDescriptor() { } - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.BIT; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/JdbcTypeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/JdbcTypeTests.java index d73f80ffea..dcd793a0c5 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/JdbcTypeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/JdbcTypeTests.java @@ -152,7 +152,7 @@ public class JdbcTypeTests { public static class CustomJdbcTypeDescriptor implements JdbcTypeDescriptor { @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.TINYINT; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AttributeConverterTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AttributeConverterTest.java index 0796bfb58e..66584146a6 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AttributeConverterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AttributeConverterTest.java @@ -238,7 +238,7 @@ public class AttributeConverterTest extends BaseUnitTestCase { } AbstractStandardBasicType basicType = assertTyping( AbstractStandardBasicType.class, type ); assertSame( StringTypeDescriptor.INSTANCE, basicType.getJavaTypeDescriptor() ); - assertEquals( Types.VARCHAR, basicType.getJdbcTypeDescriptor().getJdbcType() ); + assertEquals( Types.VARCHAR, basicType.getJdbcTypeDescriptor().getJdbcTypeCode() ); } finally { StandardServiceRegistryBuilder.destroy( ssr ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/CustomTypeConverterTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/CustomTypeConverterTest.java index 230eb05cbc..3ac9787714 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/CustomTypeConverterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/CustomTypeConverterTest.java @@ -63,7 +63,7 @@ public class CustomTypeConverterTest extends BaseUnitTestCase { ); assertThat( - bootTypeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( MyCustomJdbcTypeDescriptor.INSTANCE.getJdbcType() ), + bootTypeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( MyCustomJdbcTypeDescriptor.INSTANCE.getJdbcTypeCode() ), sameInstance( MyCustomJdbcTypeDescriptor.INSTANCE ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/MyCustomJdbcTypeDescriptor.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/MyCustomJdbcTypeDescriptor.java index cce653ce41..6e43ca44c2 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/MyCustomJdbcTypeDescriptor.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/MyCustomJdbcTypeDescriptor.java @@ -39,7 +39,7 @@ public class MyCustomJdbcTypeDescriptor implements JdbcTypeDescriptor { } @Override - public int getJdbcType() { + public int getJdbcTypeCode() { // given the Oracle example above we might want to replace the // handling of VARCHAR return Types.VARCHAR; @@ -57,7 +57,7 @@ public class MyCustomJdbcTypeDescriptor implements JdbcTypeDescriptor { protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException { final String valueStr = javaTypeDescriptor.unwrap( value, String.class, options ); if ( StringHelper.isBlank( valueStr ) ) { - st.setNull( index, getJdbcType() ); + st.setNull( index, getJdbcTypeCode() ); } else { st.setString( index, valueStr ); @@ -68,7 +68,7 @@ public class MyCustomJdbcTypeDescriptor implements JdbcTypeDescriptor { protected void doBind(CallableStatement st, X value, String name, WrapperOptions options) throws SQLException { final String valueStr = javaTypeDescriptor.unwrap( value, String.class, options ); if ( StringHelper.isBlank( valueStr ) ) { - st.setNull( name, getJdbcType() ); + st.setNull( name, getJdbcTypeCode() ); } else { st.setString( name, valueStr ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/QueryParametersValidationArrayTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/QueryParametersValidationArrayTest.java index 103100c0bb..b764373ac4 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/QueryParametersValidationArrayTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/QueryParametersValidationArrayTest.java @@ -96,7 +96,7 @@ public class QueryParametersValidationArrayTest { public static final StringArrayJdbcTypeDescriptor INSTANCE = new StringArrayJdbcTypeDescriptor(); @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.ARRAY; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/sql/ast/SmokeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/sql/ast/SmokeTests.java index 23545047f9..2a871ef36c 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/sql/ast/SmokeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/sql/ast/SmokeTests.java @@ -184,7 +184,7 @@ public class SmokeTests { assertThat( selectedExpressable, instanceOf( StandardBasicTypeImpl.class ) ); final StandardBasicTypeImpl basicType = (StandardBasicTypeImpl) selectedExpressable; assertThat( basicType.getJavaTypeDescriptor().getJavaTypeClass(), AssignableMatcher.assignableTo( Integer.class ) ); - assertThat( basicType.getJdbcTypeDescriptor().getJdbcType(), is( Types.TINYINT ) ); + assertThat( basicType.getJdbcTypeDescriptor().getJdbcTypeCode(), is( Types.TINYINT ) ); assertThat( sqlAst.getDomainResultDescriptors().size(), is( 1 ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/id/usertype/inet/InetJdbcTypeDescriptor.java b/hibernate-core/src/test/java/org/hibernate/test/id/usertype/inet/InetJdbcTypeDescriptor.java index 56be43f0d3..0b756ffb32 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/id/usertype/inet/InetJdbcTypeDescriptor.java +++ b/hibernate-core/src/test/java/org/hibernate/test/id/usertype/inet/InetJdbcTypeDescriptor.java @@ -31,7 +31,7 @@ public class InetJdbcTypeDescriptor implements JdbcTypeDescriptor { public static final InetJdbcTypeDescriptor INSTANCE = new InetJdbcTypeDescriptor(); @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.OTHER; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonJdbcTypeDescriptor.java b/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonJdbcTypeDescriptor.java index b5cceff5de..76c8ac1f3d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonJdbcTypeDescriptor.java +++ b/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonJdbcTypeDescriptor.java @@ -30,7 +30,7 @@ public class JsonJdbcTypeDescriptor implements JdbcTypeDescriptor { public static final JsonJdbcTypeDescriptor INSTANCE = new JsonJdbcTypeDescriptor(); @Override - public int getJdbcType() { + public int getJdbcTypeCode() { return Types.OTHER; }