Interface DdlType
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ArrayDdlTypeImpl
,BinaryFloatDdlType
,CapacityDependentDdlType
,DdlTypeImpl
,NamedNativeEnumDdlTypeImpl
,NamedNativeOrdinalEnumDdlTypeImpl
,NativeEnumDdlTypeImpl
,NativeOrdinalEnumDdlTypeImpl
,Scale6IntervalSecondDdlType
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 types
text
and
blob
, it's the type name itself which is parameter-dependent.-
Method Summary
Modifier and TypeMethodDescriptiondefault 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.getCastTypeName
(JdbcType jdbcType, JavaType<?> javaType) Deprecated, for removal: This API element is subject to removal in a future version.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.Deprecated.not appropriate for named enum or array typesdefault String[]
Deprecated.not appropriate for named enum or array typesint
The SQL type code of the descriptor.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
-
Method Details
-
getSqlTypeCode
int getSqlTypeCode()The SQL type code of the descriptor.- Returns:
- a SQL type code
-
getTypeName
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.not appropriate for named enum or array typesReturns the default type name without precision/length and scale parameters. -
getRawTypeNames
Deprecated.not appropriate for named enum or array typesReturns all type names without precision/length and scale parameters. -
getTypeName
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.not appropriate for named enum or array types, usegetTypeName(Size, Type, DdlTypeRegistry)
insteadReturn a type with the given length, precision, and scale. -
isLob
-
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:
-
getCastTypeName
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:
-
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:
-
getCastTypeName(Size, SqlExpressible, DdlTypeRegistry)
instead