Class DdlTypeImpl
- java.lang.Object
-
- org.hibernate.type.descriptor.sql.internal.DdlTypeImpl
-
- All Implemented Interfaces:
Serializable,DdlType
- Direct Known Subclasses:
ArrayDdlTypeImpl,BinaryFloatDdlType,CapacityDependentDdlType,Scale6IntervalSecondDdlType
public class DdlTypeImpl extends Object implements DdlType
Descriptor for a SQL type.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DdlTypeImpl(int sqlTypeCode, boolean isLob, String typeNamePattern, String castTypeNamePattern, String castTypeName, Dialect dialect)DdlTypeImpl(int sqlTypeCode, boolean isLob, String typeNamePattern, String castTypeName, Dialect dialect)DdlTypeImpl(int sqlTypeCode, String typeNamePattern, String castTypeNamePattern, String castTypeName, Dialect dialect)DdlTypeImpl(int sqlTypeCode, String typeNamePattern, String castTypeName, Dialect dialect)DdlTypeImpl(int sqlTypeCode, String typeNamePattern, Dialect dialect)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCastTypeName(JdbcType jdbcType, JavaType<?> javaType)StringgetCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)StringgetRawTypeName()Returns the default type name without precision/length and scale parameters.intgetSqlTypeCode()The SQL type code of the descriptor.StringgetTypeName(Long size, Integer precision, Integer scale)Return a type with the given length, precision, and scale.booleanisLob(Size size)static Stringreplace(String type, Long size, Integer precision, Integer scale)Fill in the placemarkers with the given length, precision, and scale.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.sql.DdlType
getCastTypeName, getCastTypeName, getRawTypeNames, getTypeName, getTypeName
-
-
-
-
Constructor Detail
-
DdlTypeImpl
public DdlTypeImpl(int sqlTypeCode, String typeNamePattern, String castTypeName, Dialect dialect)
-
DdlTypeImpl
public DdlTypeImpl(int sqlTypeCode, boolean isLob, String typeNamePattern, String castTypeName, Dialect dialect)
-
DdlTypeImpl
public DdlTypeImpl(int sqlTypeCode, String typeNamePattern, String castTypeNamePattern, String castTypeName, Dialect dialect)
-
-
Method Detail
-
getSqlTypeCode
public int getSqlTypeCode()
Description copied from interface:DdlTypeThe SQL type code of the descriptor.- Specified by:
getSqlTypeCodein interfaceDdlType- Returns:
- a SQL type code
-
getRawTypeName
public String getRawTypeName()
Description copied from interface:DdlTypeReturns the default type name without precision/length and scale parameters.- Specified by:
getRawTypeNamein interfaceDdlType
-
getTypeName
public String getTypeName(Long size, Integer precision, Integer scale)
Description copied from interface:DdlTypeReturn a type with the given length, precision, and scale.- Specified by:
getTypeNamein interfaceDdlType
-
getCastTypeName
public String getCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)
Description copied from interface:DdlTypeReturn the database type with the given length, precision, and scale, if specified, corresponding to the givenJdbcType, that may be used as a target type in casting operations using the SQLCAST()function, using the givenJavaTypeto help determine the appropriate precision and scale. The length, if not explicitly specified, is usually chosen to be the maximum possible length for the dialect.- Specified by:
getCastTypeNamein interfaceDdlType- Returns:
- The SQL type name
- See Also:
JavaType.getDefaultSqlScale(Dialect, JdbcType),JavaType.getDefaultSqlPrecision(Dialect, JdbcType),Dialect.getMaxVarcharLength()
-
getCastTypeName
public String getCastTypeName(JdbcType jdbcType, JavaType<?> javaType)
Description copied from interface:DdlTypeReturn the database type corresponding to the givenJdbcTypethat may be used as a target type in casting operations using the SQLCAST()function, using the givenJavaTypeto help determine the appropriate precision and scale. The length is usually chosen to be the maximum possible length for the dialect.- Specified by:
getCastTypeNamein interfaceDdlType- Returns:
- The SQL type name
- See Also:
JavaType.getDefaultSqlScale(Dialect, JdbcType),JavaType.getDefaultSqlPrecision(Dialect, JdbcType),Dialect.getMaxVarcharLength()
-
-