Class DdlTypeImpl
- java.lang.Object
-
- org.hibernate.type.descriptor.sql.internal.DdlTypeImpl
-
- All Implemented Interfaces:
Serializable
,DdlType
- Direct Known Subclasses:
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 String
getCastTypeName(JdbcType jdbcType, JavaType<?> javaType)
String
getCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)
String
getRawTypeName()
Returns the default type name without precision/length and scale parameters.int
getSqlTypeCode()
The SQL type code of the descriptor.String
getTypeName(Long size, Integer precision, Integer scale)
Return a type with the given length, precision, and scale.String
getTypeNamePattern()
boolean
isLob(Size size)
static String
replace(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, getRawTypeNames, 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:DdlType
The SQL type code of the descriptor.- Specified by:
getSqlTypeCode
in interfaceDdlType
- Returns:
- a SQL type code
-
getRawTypeName
public String getRawTypeName()
Description copied from interface:DdlType
Returns the default type name without precision/length and scale parameters.- Specified by:
getRawTypeName
in interfaceDdlType
-
getTypeNamePattern
public String getTypeNamePattern()
- Specified by:
getTypeNamePattern
in interfaceDdlType
-
getTypeName
public String getTypeName(Long size, Integer precision, Integer scale)
Description copied from interface:DdlType
Return a type with the given length, precision, and scale.- Specified by:
getTypeName
in interfaceDdlType
-
getCastTypeName
public String getCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)
Description copied from interface:DdlType
Return 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 givenJavaType
to 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:
getCastTypeName
in 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:DdlType
Return the database type corresponding to the givenJdbcType
that may be used as a target type in casting operations using the SQLCAST()
function, using the givenJavaType
to help determine the appropriate precision and scale. The length is usually chosen to be the maximum possible length for the dialect.- Specified by:
getCastTypeName
in interfaceDdlType
- Returns:
- The SQL type name
- See Also:
JavaType.getDefaultSqlScale(Dialect, JdbcType)
,JavaType.getDefaultSqlPrecision(Dialect, JdbcType)
,Dialect.getMaxVarcharLength()
-
-