diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryJdbcType.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryJdbcType.java index b147796c6a..d886344415 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryJdbcType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryJdbcType.java @@ -14,14 +14,19 @@ import java.sql.Types; public class LongVarbinaryJdbcType extends VarbinaryJdbcType { public static final LongVarbinaryJdbcType INSTANCE = new LongVarbinaryJdbcType(); - private final int jdbcTypeCode; + private final int defaultSqlTypeCode; public LongVarbinaryJdbcType() { - this(Types.LONGVARBINARY); + this( Types.LONGVARBINARY ); } - public LongVarbinaryJdbcType(int jdbcTypeCode) { - this.jdbcTypeCode = jdbcTypeCode; + public LongVarbinaryJdbcType(int defaultSqlTypeCode) { + this.defaultSqlTypeCode = defaultSqlTypeCode; + } + + @Override + public int getDefaultSqlTypeCode() { + return defaultSqlTypeCode; } @Override @@ -31,6 +36,6 @@ public class LongVarbinaryJdbcType extends VarbinaryJdbcType { @Override public int getJdbcTypeCode() { - return jdbcTypeCode; + return Types.LONGVARBINARY; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharJdbcType.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharJdbcType.java index 5740bf3731..f882b5aada 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharJdbcType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharJdbcType.java @@ -4,13 +4,13 @@ */ package org.hibernate.type.descriptor.jdbc; -import java.sql.Types; - import org.hibernate.type.SqlTypes; import org.hibernate.type.descriptor.java.JavaType; import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry; import org.hibernate.type.spi.TypeConfiguration; +import java.sql.Types; + /** * Descriptor for {@link Types#LONGVARCHAR LONGVARCHAR} handling. * @@ -19,14 +19,14 @@ import org.hibernate.type.spi.TypeConfiguration; public class LongVarcharJdbcType extends VarcharJdbcType { public static final LongVarcharJdbcType INSTANCE = new LongVarcharJdbcType(); - private final int jdbcTypeCode; + private final int defaultSqlTypeCode; public LongVarcharJdbcType() { - this(Types.LONGVARCHAR); + this( Types.LONGVARCHAR ); } - public LongVarcharJdbcType(int jdbcTypeCode) { - this.jdbcTypeCode = jdbcTypeCode; + public LongVarcharJdbcType(int defaultSqlTypeCode) { + this.defaultSqlTypeCode = defaultSqlTypeCode; } @Override @@ -36,7 +36,12 @@ public class LongVarcharJdbcType extends VarcharJdbcType { @Override public int getJdbcTypeCode() { - return jdbcTypeCode; + return Types.LONGVARCHAR; + } + + @Override + public int getDefaultSqlTypeCode() { + return defaultSqlTypeCode; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcTypeBaseline.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcTypeBaseline.java index 3cba38590b..e8d1917629 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcTypeBaseline.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcTypeBaseline.java @@ -85,12 +85,12 @@ public class JdbcTypeBaseline { target.addDescriptor( BinaryJdbcType.INSTANCE ); target.addDescriptor( VarbinaryJdbcType.INSTANCE ); target.addDescriptor( LongVarbinaryJdbcType.INSTANCE ); - target.addDescriptor( new LongVarbinaryJdbcType(SqlTypes.LONG32VARBINARY) ); + target.addDescriptor( new LongVarbinaryJdbcType( SqlTypes.LONG32VARBINARY) ); target.addDescriptor( CharJdbcType.INSTANCE ); target.addDescriptor( VarcharJdbcType.INSTANCE ); target.addDescriptor( LongVarcharJdbcType.INSTANCE ); - target.addDescriptor( new LongVarcharJdbcType(SqlTypes.LONG32VARCHAR) ); + target.addDescriptor( new LongVarcharJdbcType( SqlTypes.LONG32VARCHAR) ); target.addDescriptor( BlobJdbcType.DEFAULT ); target.addDescriptor( ClobJdbcType.DEFAULT ); @@ -101,7 +101,7 @@ public class JdbcTypeBaseline { target.addDescriptor( Types.NVARCHAR, VarcharJdbcType.INSTANCE ); target.addDescriptor( Types.LONGNVARCHAR, LongVarcharJdbcType.INSTANCE ); target.addDescriptor( Types.NCLOB, ClobJdbcType.DEFAULT ); - target.addDescriptor( new LongVarcharJdbcType(SqlTypes.LONG32NVARCHAR) ); + target.addDescriptor( new LongVarcharJdbcType( SqlTypes.LONG32NVARCHAR) ); target.addDescriptor( RowIdJdbcType.INSTANCE ); }