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 int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptiondefault long
Useful for resolutions based on column length.default int
Useful for resolutions based on column precision.default int
Useful for resolutions based on column scale.default TimeZoneStorageStrategy
The defaultTimeZoneStorageStrategy
.default int
default int
default EnumType
For enum mappings, what style of storage was requested (name vs.default Integer
Used (for now) only to choose a containerJdbcType
for SQL arrays.default JdbcType
getJdbcType
(int jdbcTypeCode) TheJdbcType
registered under the given type code with the associatedJdbcTypeRegistry
.default int
When mapping a basic array or collection type to the database what is the preferred SQL type code to use?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?default int
When mapping a boolean type to the database what is the preferred SQL type code to use?default int
When mapping a duration type to the database what is the preferred SQL type code to use?default int
When mapping an instant type to the database what is the preferred SQL type code to use?default int
When mapping an uuid type to the database what is the preferred SQL type code to use?default TemporalType
For temporal type mappings, what precision was requested?Provides access to theTypeConfiguration
for access to various type system related registries.static int
getZonedTimeSqlType
(TimeZoneStorageStrategy storageStrategy) static int
getZonedTimestampSqlType
(TimeZoneStorageStrategy storageStrategy) default boolean
isLob()
Was LOB datatype requested for the given Java type?default boolean
Was nationalized character datatype requested for the given Java type?default boolean
default boolean
default boolean
Whether to use the legacy format for serializing/deserializing XML data.default boolean
Should native queries return JDBC datetime types instead of usingjava.time
types.default int
resolveJdbcTypeCode
(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:
true
if nationalized character datatype should be used;false
otherwise.
-
isLob
default boolean isLob()Was LOB datatype requested for the given Java type?- Returns:
true
if LOB datatype should be used;false
otherwise.
-
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
NUMERIC
andINTERVAL SECOND
. -
getExplicitJdbcTypeCode
Used (for now) only to choose a containerJdbcType
for SQL arrays.- Since:
- 6.3
-
getDefaultTimeZoneStorageStrategy
The defaultTimeZoneStorageStrategy
. -
getJdbcType
TheJdbcType
registered 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.time
types.- 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 theTypeConfiguration
for 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()
-