Interface DdlType
-
- All Superinterfaces:
Serializable
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 typestextandblob, 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 StringgetCastTypeName(Size columnSize, SqlExpressible type, DdlTypeRegistry ddlTypeRegistry)Return the database type corresponding to the givenSqlExpressiblethat may be used as a target type in casting operations using the SQLCAST()function.default StringgetCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale)Deprecated, for removal: This API element is subject to removal in a future version.StringgetCastTypeName(JdbcType jdbcType, JavaType<?> javaType)Deprecated, for removal: This API element is subject to removal in a future version.StringgetCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)Deprecated, for removal: This API element is subject to removal in a future version.StringgetRawTypeName()Deprecated.not appropriate for named enum or array typesdefault String[]getRawTypeNames()Deprecated.not appropriate for named enum or array typesintgetSqlTypeCode()The SQL type code of the descriptor.StringgetTypeName(Long size, Integer precision, Integer scale)Deprecated.not appropriate for named enum or array types, usegetTypeName(Size, Type, DdlTypeRegistry)insteaddefault StringgetTypeName(Size size)Deprecated.not appropriate for named enum or array types, usegetTypeName(Size, Type, DdlTypeRegistry)insteaddefault StringgetTypeName(Size columnSize, Type type, DdlTypeRegistry ddlTypeRegistry)Return a type with length, precision, and scale specified by the given size object.default booleanisLob(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 givenSqlExpressiblethat 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 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.- 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 theJdbcMappingof the givenSqlExpressible, that may be used as a target type in casting operations using the SQLCAST()function.- Parameters:
type- theSqlExpressiblelength- 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 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.- Returns:
- The SQL type name
- See Also:
JavaType.getDefaultSqlScale(Dialect, JdbcType),JavaType.getDefaultSqlPrecision(Dialect, JdbcType),Dialect.getMaxVarcharLength()
-
-