Interface JdbcTypeIndicators
- All Known Implementing Classes:
BaseSqmToSqlAstConverter,BasicValue,BasicValueBinder,DelegatingJdbcTypeIndicators,DependantBasicValue,MultiTableSqmMutationConverter,StandardSqmTranslator,SybaseSqmToSqlAstConverter
public interface JdbcTypeIndicators
A parameter object that helps determine the
SQL/JDBC type
recommended by the JDBC spec (explicitly or implicitly) for a given Java type.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptiondefault longUseful for resolutions based on column length.default intUseful for resolutions based on column precision.default intUseful for resolutions based on column scale.default TimeZoneStorageStrategyThe defaultTimeZoneStorageStrategy.default intdefault intdefault EnumTypeFor enum mappings, what style of storage was requested (name vs.default IntegerUsed (for now) only to choose a containerJdbcTypefor SQL arrays.default JdbcTypegetJdbcType(int jdbcTypeCode) TheJdbcTyperegistered under the given type code with the associatedJdbcTypeRegistry.default intWhen mapping a basic array or collection type to the database what is the preferred SQL type code to use?default intgetPreferredSqlTypeCodeForArray(int elementSqlTypeCode) When mapping a basic array or collection type to the database what is the preferred SQL type code to use, given the element SQL type code?default intWhen mapping a boolean type to the database what is the preferred SQL type code to use?default intWhen mapping a duration type to the database what is the preferred SQL type code to use?default intWhen mapping an instant type to the database what is the preferred SQL type code to use?default intWhen mapping an uuid type to the database what is the preferred SQL type code to use?default TemporalTypeFor temporal type mappings, what precision was requested?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 booleanWas nationalized character datatype requested for the given Java type?default booleandefault booleandefault booleanWhether to use the legacy format for serializing/deserializing XML data.default booleanShould native queries return JDBC datetime types instead of usingjava.timetypes.default intresolveJdbcTypeCode(int jdbcTypeCode) Resolves the given type code to a possibly different type code, based on context.
-
Field Details
-
NO_COLUMN_LENGTH
static final int NO_COLUMN_LENGTH- See Also:
-
NO_COLUMN_PRECISION
static final int NO_COLUMN_PRECISION- See Also:
-
NO_COLUMN_SCALE
static final int NO_COLUMN_SCALE- See Also:
-
-
Method Details
-
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
For enum mappings, what style of storage was requested (name vs. ordinal)?- Returns:
- The enum type.
-
getTemporalPrecision
For temporal type mappings, what precision was requested? -
isPreferJavaTimeJdbcTypesEnabled
default boolean isPreferJavaTimeJdbcTypesEnabled() -
isPreferNativeEnumTypesEnabled
default boolean isPreferNativeEnumTypesEnabled()- See Also:
-
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:
-
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:
-
getPreferredSqlTypeCodeForArray
default int getPreferredSqlTypeCodeForArray(int elementSqlTypeCode) When mapping a basic array or collection type to the database what is the preferred SQL type code to use, given the element SQL type code?Returns a key into the
JdbcTypeRegistry.- Since:
- 7.0
- See Also:
-
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
Used (for now) only to choose a containerJdbcTypefor SQL arrays.- Since:
- 6.3
-
getDefaultTimeZoneStorageStrategy
The defaultTimeZoneStorageStrategy. -
getJdbcType
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
-
preferJdbcDatetimeTypes
default boolean preferJdbcDatetimeTypes()Should native queries return JDBC datetime types instead of usingjava.timetypes.- Since:
- 7.0
- See Also:
-
isXmlFormatMapperLegacyFormatEnabled
Whether to use the legacy format for serializing/deserializing XML data.- Since:
- 7.0
- See Also:
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()Provides access to theTypeConfigurationfor access to various type system related registries. -
getZonedTimeSqlType
- Returns:
- the SQL column type used for storing times under the given storage strategy
- See Also:
-
getZonedTimestampSqlType
- Returns:
- the SQL column type used for storing datetimes under the given storage strategy
- See Also:
-
getDefaultZonedTimeSqlType
default int getDefaultZonedTimeSqlType()- Returns:
- the SQL column type used for storing datetimes under the default storage strategy
- See Also:
-
getDefaultZonedTimestampSqlType
default int getDefaultZonedTimestampSqlType()- Returns:
- the SQL column type used for storing datetimes under the default storage strategy
- See Also:
-
getDialect
Dialect getDialect()
-