remove older getJdbcType() method
This commit is contained in:
parent
526b3659c8
commit
7aeb03beea
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class PostgresUUIDType extends AbstractSingleColumnStandardBasicType<UUID
|
|||
private static final int JDBC_TYPE_CODE = 3975;
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return JDBC_TYPE_CODE;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public class StandardBasicTypeTemplate<J> extends AbstractSingleColumnStandardBa
|
|||
this.registrationKeys = registrationKeys;
|
||||
|
||||
this.name = javaTypeDescriptor.getJavaType() == null ? "(map-mode)" : javaTypeDescriptor.getJavaType().getTypeName()
|
||||
+ " -> " + jdbcTypeDescriptor.getJdbcType();
|
||||
+ " -> " + jdbcTypeDescriptor.getJdbcTypeCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -51,8 +51,8 @@ public class AttributeConverterJdbcTypeDescriptorAdapter implements JdbcTypeDesc
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
return delegate.getJdbcType();
|
||||
public int getJdbcTypeCode() {
|
||||
return delegate.getJdbcTypeCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,7 +32,7 @@ public class BigIntTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.BIGINT;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public class BinaryTypeDescriptor extends VarbinaryTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.BINARY;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public abstract class BlobTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.BLOB;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public class BooleanTypeDescriptor implements JdbcTypeDescriptor {
|
|||
public BooleanTypeDescriptor() {
|
||||
}
|
||||
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.BOOLEAN;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public class CharTypeDescriptor extends VarcharTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.CHAR;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class DateTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.DATE;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public class DecimalTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.DECIMAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class DoubleTypeDescriptor implements JdbcTypeDescriptor {
|
|||
* @return {@link Types#DOUBLE}
|
||||
*/
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.DOUBLE;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class FloatTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.FLOAT;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class IntegerTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.INTEGER;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* @see #getJdbcType
|
||||
*/
|
||||
default int getJdbcTypeCode() {
|
||||
return getJdbcType();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return a JDBC type code
|
||||
*/
|
||||
default int getDefaultSqlTypeCode() {
|
||||
return getJdbcType();
|
||||
return getJdbcTypeCode();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,7 +25,7 @@ public class LongNVarcharTypeDescriptor extends NVarcharTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.LONGNVARCHAR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class LongVarbinaryTypeDescriptor extends VarbinaryTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.LONGVARBINARY;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class LongVarcharTypeDescriptor extends VarcharTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.LONGVARCHAR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class NCharTypeDescriptor extends NVarcharTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.NCHAR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class NVarcharTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.NVARCHAR;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public class NumericTypeDescriptor extends DecimalTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.NUMERIC;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class ObjectJdbcTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return jdbcTypeCode;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ public class RealTypeDescriptor extends FloatTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.REAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class SmallIntTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.SMALLINT;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class TimeTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.TIME;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class TimestampTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.TIMESTAMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class TimestampWithTimeZoneDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.TIMESTAMP_WITH_TIMEZONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class TinyIntTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.TINYINT;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class VarbinaryTypeDescriptor implements JdbcTypeDescriptor {
|
|||
return "VarbinaryTypeDescriptor";
|
||||
}
|
||||
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.VARBINARY;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class VarcharTypeDescriptor implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.VARCHAR;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class UserTypeSqlTypeAdapter<J> implements JdbcTypeDescriptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return userType.sqlTypes()[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -616,7 +616,7 @@ class BitTypeDescriptor implements JdbcTypeDescriptor {
|
|||
public BitTypeDescriptor() {
|
||||
}
|
||||
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.BIT;
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ public class JdbcTypeTests {
|
|||
|
||||
public static class CustomJdbcTypeDescriptor implements JdbcTypeDescriptor {
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.TINYINT;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 )
|
||||
);
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -96,7 +96,7 @@ public class QueryParametersValidationArrayTest {
|
|||
public static final StringArrayJdbcTypeDescriptor INSTANCE = new StringArrayJdbcTypeDescriptor();
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.ARRAY;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue