Interface DdlType
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ArrayDdlTypeImpl
,BinaryFloatDdlType
,CapacityDependentDdlType
,DdlTypeImpl
,NamedNativeEnumDdlTypeImpl
,NamedNativeOrdinalEnumDdlTypeImpl
,NativeEnumDdlTypeImpl
,NativeOrdinalEnumDdlTypeImpl
,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 Deprecated Methods Modifier and Type Method Description default String
getCastTypeName(Size columnSize, SqlExpressible type, DdlTypeRegistry ddlTypeRegistry)
Return the database type corresponding to the givenSqlExpressible
that may be used as a target type in casting operations using the SQLCAST()
function.default String
getCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale)
Deprecated, for removal: This API element is subject to removal in a future version.String
getCastTypeName(JdbcType jdbcType, JavaType<?> javaType)
Deprecated, for removal: This API element is subject to removal in a future version.String
getCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)
Deprecated, for removal: This API element is subject to removal in a future version.String
getRawTypeName()
Deprecated.not appropriate for named enum or array typesdefault String[]
getRawTypeNames()
Deprecated.not appropriate for named enum or array typesint
getSqlTypeCode()
The SQL type code of the descriptor.String
getTypeName(Long size, Integer precision, Integer scale)
Deprecated.not appropriate for named enum or array types, usegetTypeName(Size, Type, DdlTypeRegistry)
insteaddefault String
getTypeName(Size size)
Deprecated.not appropriate for named enum or array types, usegetTypeName(Size, Type, DdlTypeRegistry)
insteaddefault String
getTypeName(Size columnSize, Type type, DdlTypeRegistry ddlTypeRegistry)
Return a type with length, precision, and scale specified by the given size object.default boolean
isLob(Size size)
-
-
-
Method Detail
-
getSqlTypeCode
int getSqlTypeCode()
The SQL type code of the descriptor.- Returns:
- a SQL type code
-
getTypeName
default String getTypeName(Size columnSize, Type type, DdlTypeRegistry ddlTypeRegistry)
Return a type with length, precision, and scale specified by the given size object. The given type may be used to determine additional aspects of the returned SQL type.- Since:
- 6.3
-
getRawTypeName
@Deprecated(since="6.3") String getRawTypeName()
Deprecated.not appropriate for named enum or array typesReturns the default type name without precision/length and scale parameters.
-
getRawTypeNames
@Incubating @Deprecated(since="6.3") default String[] getRawTypeNames()
Deprecated.not appropriate for named enum or array typesReturns all type names without precision/length and scale parameters.
-
getTypeName
@Deprecated(since="6.3") default String getTypeName(Size size)
Deprecated.not appropriate for named enum or array types, usegetTypeName(Size, Type, DdlTypeRegistry)
insteadReturn a type with length, precision, and scale specified by the given size object.
-
getTypeName
@Deprecated(since="6.3") String getTypeName(Long size, Integer precision, Integer scale)
Deprecated.not appropriate for named enum or array types, usegetTypeName(Size, Type, DdlTypeRegistry)
insteadReturn a type with the given length, precision, and scale.
-
isLob
default boolean isLob(Size size)
-
getCastTypeName
default String getCastTypeName(Size columnSize, SqlExpressible type, DdlTypeRegistry ddlTypeRegistry)
Return the database type corresponding to the givenSqlExpressible
that may be used as a target type in casting operations using the SQLCAST()
function. The length is usually chosen to be the maximum possible length for the dialect.- Returns:
- The SQL type name
- Since:
- 6.3
- See Also:
JavaType.getDefaultSqlScale(Dialect, JdbcType)
,JavaType.getDefaultSqlPrecision(Dialect, JdbcType)
,Dialect.getMaxVarcharLength()
-
getCastTypeName
@Deprecated(forRemoval=true) String getCastTypeName(JdbcType jdbcType, JavaType<?> javaType)
Deprecated, for removal: This API element is subject to removal in a future version.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
@Deprecated(forRemoval=true) default String getCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale)
Deprecated, for removal: This API element is subject to removal in a future version.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
@Deprecated(forRemoval=true) String getCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)
Deprecated, for removal: This API element is subject to removal in a future version.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()
-
-