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 Modifier and Type Method Description default StringgetCastTypeName(SqlExpressible type, Long length, Integer precision, Integer scale)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.StringgetCastTypeName(JdbcType jdbcType, JavaType<?> javaType)StringgetCastTypeName(JdbcType jdbcType, JavaType<?> javaType, Long length, Integer precision, Integer scale)StringgetRawTypeName()Returns the default type name without precision/length and scale parameters.default String[]getRawTypeNames()Returns all type names without precision/length and scale parameters.intgetSqlTypeCode()The SQL type code of the descriptor.StringgetTypeName(Long size, Integer precision, Integer scale)Return a type with the given length, precision, and scale.default StringgetTypeName(Size size)Return a type with length, precision, and scale specified by the given size object.StringgetTypeNamePattern()default booleanisLob(Size size)
-
-
-
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
@Incubating 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.
-
isLob
default boolean isLob(Size size)
-
getCastTypeName
String getCastTypeName(JdbcType jdbcType, JavaType<?> javaType)
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
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 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
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 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()
-
-