Interface JdbcTypeIndicators
-
- All Known Implementing Classes:
BaseSqmToSqlAstConverter
,BasicValue
,BasicValueBinder
,DelegatingJdbcTypeIndicators
,DependantBasicValue
,MockSessionFactory
,MultiTableSqmMutationConverter
,ProcessorSessionFactory
,StandardSqmTranslator
,SybaseSqmToSqlAstConverter
public interface JdbcTypeIndicators
A parameter object that helps determine theSQL/JDBC type
recommended by the JDBC spec (explicitly or implicitly) for a given Java type.
-
-
Field Summary
Fields Modifier and Type Field Description static int
NO_COLUMN_LENGTH
static int
NO_COLUMN_PRECISION
static int
NO_COLUMN_SCALE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default long
getColumnLength()
Useful for resolutions based on column length.default int
getColumnPrecision()
Useful for resolutions based on column precision.default int
getColumnScale()
Useful for resolutions based on column scale.default TimeZoneStorageStrategy
getDefaultTimeZoneStorageStrategy()
The defaultTimeZoneStorageStrategy
.default int
getDefaultZonedTimeSqlType()
default int
getDefaultZonedTimestampSqlType()
Dialect
getDialect()
default EnumType
getEnumeratedType()
For enum mappings, what style of storage was requested (name vs.default Integer
getExplicitJdbcTypeCode()
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
getPreferredSqlTypeCodeForArray()
When mapping a basic array or collection type to the database what is the preferred SQL type code to use?default int
getPreferredSqlTypeCodeForBoolean()
When mapping a boolean type to the database what is the preferred SQL type code to use?default int
getPreferredSqlTypeCodeForDuration()
When mapping a duration type to the database what is the preferred SQL type code to use?default int
getPreferredSqlTypeCodeForInstant()
When mapping an instant type to the database what is the preferred SQL type code to use?default int
getPreferredSqlTypeCodeForUuid()
When mapping an uuid type to the database what is the preferred SQL type code to use?default TemporalType
getTemporalPrecision()
For temporal type mappings, what precision was requested?TypeConfiguration
getTypeConfiguration()
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
isNationalized()
Was nationalized character datatype requested for the given Java type?default boolean
isPreferJavaTimeJdbcTypesEnabled()
default boolean
isPreferNativeEnumTypesEnabled()
default int
resolveJdbcTypeCode(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:
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
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
NUMERIC
andINTERVAL SECOND
.
-
getExplicitJdbcTypeCode
@Incubating default Integer getExplicitJdbcTypeCode()
Used (for now) only to choose a containerJdbcType
for SQL arrays.- Since:
- 6.3
-
getDefaultTimeZoneStorageStrategy
default TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
The defaultTimeZoneStorageStrategy
.
-
getJdbcType
default JdbcType getJdbcType(int jdbcTypeCode)
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
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()
Provides access to theTypeConfiguration
for 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()
-
-