Interface JdbcTypeIndicators
-
- All Known Implementing Classes:
BaseSqmToSqlAstConverter,BasicValue,BasicValueBinder,DelegatingJdbcTypeIndicators,DependantBasicValue,MockSessionFactory,MultiTableSqmMutationConverter,ProcessorSessionFactory,StandardSqmTranslator,SybaseSqmToSqlAstConverter
public interface JdbcTypeIndicatorsA parameter object that helps determine theSQL/JDBC typerecommended by the JDBC spec (explicitly or implicitly) for a given Java type.
-
-
Field Summary
Fields Modifier and Type Field Description static intNO_COLUMN_LENGTHstatic intNO_COLUMN_PRECISIONstatic intNO_COLUMN_SCALE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default longgetColumnLength()Useful for resolutions based on column length.default intgetColumnPrecision()Useful for resolutions based on column precision.default intgetColumnScale()Useful for resolutions based on column scale.default TimeZoneStorageStrategygetDefaultTimeZoneStorageStrategy()The defaultTimeZoneStorageStrategy.default intgetDefaultZonedTimeSqlType()default intgetDefaultZonedTimestampSqlType()DialectgetDialect()default EnumTypegetEnumeratedType()For enum mappings, what style of storage was requested (name vs.default IntegergetExplicitJdbcTypeCode()Used (for now) only to choose a containerJdbcTypefor SQL arrays.default JdbcTypegetJdbcType(int jdbcTypeCode)TheJdbcTyperegistered under the given type code with the associatedJdbcTypeRegistry.default intgetPreferredSqlTypeCodeForArray()When mapping a basic array or collection type to the database what is the preferred SQL type code to use?default intgetPreferredSqlTypeCodeForBoolean()When mapping a boolean type to the database what is the preferred SQL type code to use?default intgetPreferredSqlTypeCodeForDuration()When mapping a duration type to the database what is the preferred SQL type code to use?default intgetPreferredSqlTypeCodeForInstant()When mapping an instant type to the database what is the preferred SQL type code to use?default intgetPreferredSqlTypeCodeForUuid()When mapping an uuid type to the database what is the preferred SQL type code to use?default TemporalTypegetTemporalPrecision()For temporal type mappings, what precision was requested?TypeConfigurationgetTypeConfiguration()Provides access to theTypeConfigurationfor access to various type system related registries.static intgetZonedTimeSqlType(TimeZoneStorageStrategy storageStrategy)static intgetZonedTimestampSqlType(TimeZoneStorageStrategy storageStrategy)default booleanisLob()Was LOB datatype requested for the given Java type?default booleanisNationalized()Was nationalized character datatype requested for the given Java type?default booleanisPreferJavaTimeJdbcTypesEnabled()default booleanisPreferNativeEnumTypesEnabled()default intresolveJdbcTypeCode(int jdbcTypeCode)Resolves the given type code to a possibly different type code, based on context.
-
-
-
Field Detail
-
NO_COLUMN_LENGTH
static final int NO_COLUMN_LENGTH
- See Also:
- Constant Field Values
-
NO_COLUMN_PRECISION
static final int NO_COLUMN_PRECISION
- See Also:
- Constant Field Values
-
NO_COLUMN_SCALE
static final int NO_COLUMN_SCALE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isNationalized
default boolean isNationalized()
Was nationalized character datatype requested for the given Java type?- Returns:
trueif nationalized character datatype should be used;falseotherwise.
-
isLob
default boolean isLob()
Was LOB datatype requested for the given Java type?- Returns:
trueif LOB datatype should be used;falseotherwise.
-
getEnumeratedType
default EnumType getEnumeratedType()
For enum mappings, what style of storage was requested (name vs. ordinal)?- Returns:
- The enum type.
-
getTemporalPrecision
default TemporalType getTemporalPrecision()
For temporal type mappings, what precision was requested?
-
isPreferJavaTimeJdbcTypesEnabled
default boolean isPreferJavaTimeJdbcTypesEnabled()
-
isPreferNativeEnumTypesEnabled
default boolean isPreferNativeEnumTypesEnabled()
- See Also:
MappingSettings.PREFER_NATIVE_ENUM_TYPES
-
getPreferredSqlTypeCodeForBoolean
default int getPreferredSqlTypeCodeForBoolean()
When mapping a boolean type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.
-
getPreferredSqlTypeCodeForDuration
default int getPreferredSqlTypeCodeForDuration()
When mapping a duration type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.
-
getPreferredSqlTypeCodeForUuid
default int getPreferredSqlTypeCodeForUuid()
When mapping an uuid type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.- See Also:
MappingSettings.PREFERRED_UUID_JDBC_TYPE
-
getPreferredSqlTypeCodeForInstant
default int getPreferredSqlTypeCodeForInstant()
When mapping an instant type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.
-
getPreferredSqlTypeCodeForArray
default int getPreferredSqlTypeCodeForArray()
When mapping a basic array or collection type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.- Since:
- 6.1
- See Also:
Dialect.getPreferredSqlTypeCodeForArray()
-
getColumnLength
default long getColumnLength()
Useful for resolutions based on column length.E.g. for choosing between a
VARCHAR(String) andCHAR(1)(Character/char).
-
getColumnPrecision
default int getColumnPrecision()
Useful for resolutions based on column precision.
-
getColumnScale
default int getColumnScale()
Useful for resolutions based on column scale.E.g. for choosing between a
NUMERICandINTERVAL SECOND.
-
getExplicitJdbcTypeCode
@Incubating default Integer getExplicitJdbcTypeCode()
Used (for now) only to choose a containerJdbcTypefor SQL arrays.- Since:
- 6.3
-
getDefaultTimeZoneStorageStrategy
default TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
The defaultTimeZoneStorageStrategy.
-
getJdbcType
default JdbcType getJdbcType(int jdbcTypeCode)
TheJdbcTyperegistered under the given type code with the associatedJdbcTypeRegistry.
-
resolveJdbcTypeCode
default int resolveJdbcTypeCode(int jdbcTypeCode)
Resolves the given type code to a possibly different type code, based on context. A database might not support a certain type code in certain scenarios like within a UDT and has to resolve to a different type code in such a scenario.- Parameters:
jdbcTypeCode- a type code fromSqlTypes- Returns:
- The jdbc type code to use
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()
Provides access to theTypeConfigurationfor access to various type system related registries.
-
getZonedTimeSqlType
static int getZonedTimeSqlType(TimeZoneStorageStrategy storageStrategy)
- Returns:
- the SQL column type used for storing times under the given storage strategy
- See Also:
SqlTypes.TIME_WITH_TIMEZONE,SqlTypes.TIME,SqlTypes.TIME_UTC
-
getZonedTimestampSqlType
static int getZonedTimestampSqlType(TimeZoneStorageStrategy storageStrategy)
- Returns:
- the SQL column type used for storing datetimes under the given storage strategy
- See Also:
SqlTypes.TIME_WITH_TIMEZONE,SqlTypes.TIMESTAMP,SqlTypes.TIMESTAMP_UTC
-
getDefaultZonedTimeSqlType
default int getDefaultZonedTimeSqlType()
- Returns:
- the SQL column type used for storing datetimes under the default storage strategy
- See Also:
SqlTypes.TIME_WITH_TIMEZONE,SqlTypes.TIME,SqlTypes.TIME_UTC
-
getDefaultZonedTimestampSqlType
default int getDefaultZonedTimestampSqlType()
- Returns:
- the SQL column type used for storing datetimes under the default storage strategy
- See Also:
SqlTypes.TIME_WITH_TIMEZONE,SqlTypes.TIMESTAMP,SqlTypes.TIMESTAMP_UTC
-
getDialect
Dialect getDialect()
-
-