Interface DdlType
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BinaryFloatDdlType
,CapacityDependentDdlType
,DdlTypeImpl
,Scale6IntervalSecondDdlType
public interface DdlType extends Serializable
Descriptor for a DDL column type. An instance of this type abstracts over a parameterized family of dialect-specific SQL types with the same type code but varying length, precision, and scale. Usually, the types belonging to the family share a single type name in SQL, but in certain cases, most notably, in the case of the MySQL LOB typestext
andblob
, it's the type name itself which is parameter-dependent.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default String
getCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale)
Return the database type with the given length, precision, and scale, if specified, corresponding to theJdbcMapping
of the givenSqlExpressible
, that may be used as a target type in casting operations using the SQLCAST()
function.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.default String[]
getRawTypeNames()
Returns all type names 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.default String
getTypeName(Size size)
Return a type with length, precision, and scale specified by the given size object.String
getTypeNamePattern()
-
-
-
Method Detail
-
getSqlTypeCode
int getSqlTypeCode()
The SQL type code of the descriptor.- Returns:
- a SQL type code
-
getRawTypeName
String getRawTypeName()
Returns the default type name without precision/length and scale parameters.
-
getRawTypeNames
default String[] getRawTypeNames()
Returns all type names without precision/length and scale parameters.
-
getTypeNamePattern
String getTypeNamePattern()
-
getTypeName
default String getTypeName(Size size)
Return a type with length, precision, and scale specified by the given size object.
-
getTypeName
String getTypeName(Long size, Integer precision, Integer scale)
Return a type with the given length, precision, and scale.
-
getCastTypeName
String getCastTypeName(JdbcType jdbcType, JavaType<?> javaType)
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.- Returns:
- The SQL type name
- See Also:
JavaType.getDefaultSqlScale(Dialect, JdbcType)
,JavaType.getDefaultSqlPrecision(Dialect, JdbcType)
,Dialect.getMaxVarcharLength()
-
getCastTypeName
default String getCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale)
Return the database type with the given length, precision, and scale, if specified, corresponding to theJdbcMapping
of the givenSqlExpressible
, that may be used as a target type in casting operations using the SQLCAST()
function.- Parameters:
type
- theSqlExpressible
length
- the length, or null, if unspecifiedprecision
- the precision, or null, if unspecifiedscale
- the scale, or null, if unspecified- Returns:
- The SQL type name
-
getCastTypeName
String getCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)
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.- Returns:
- The SQL type name
- See Also:
JavaType.getDefaultSqlScale(Dialect, JdbcType)
,JavaType.getDefaultSqlPrecision(Dialect, JdbcType)
,Dialect.getMaxVarcharLength()
-
-