Class DelegatingJdbcTypeIndicators
- java.lang.Object
-
- org.hibernate.type.descriptor.jdbc.DelegatingJdbcTypeIndicators
-
- All Implemented Interfaces:
JdbcTypeIndicators
public class DelegatingJdbcTypeIndicators extends Object implements JdbcTypeIndicators
-
-
Field Summary
-
Fields inherited from interface org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators
NO_COLUMN_LENGTH, NO_COLUMN_PRECISION, NO_COLUMN_SCALE
-
-
Constructor Summary
Constructors Constructor Description DelegatingJdbcTypeIndicators(JdbcTypeIndicators delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getColumnLength()
Useful for resolutions based on column length.int
getColumnPrecision()
Useful for resolutions based on column precision.int
getColumnScale()
Useful for resolutions based on column scale.TimeZoneStorageStrategy
getDefaultTimeZoneStorageStrategy()
The defaultTimeZoneStorageStrategy
.int
getDefaultZonedTimeSqlType()
int
getDefaultZonedTimestampSqlType()
Dialect
getDialect()
EnumType
getEnumeratedType()
For enum mappings, what style of storage was requested (name vs.Integer
getExplicitJdbcTypeCode()
Used (for now) only to choose a containerJdbcType
for SQL arrays.JdbcType
getJdbcType(int jdbcTypeCode)
TheJdbcType
registered under the given type code with the associatedJdbcTypeRegistry
.int
getPreferredSqlTypeCodeForArray()
When mapping a basic array or collection type to the database what is the preferred SQL type code to use?int
getPreferredSqlTypeCodeForBoolean()
When mapping a boolean type to the database what is the preferred SQL type code to use?int
getPreferredSqlTypeCodeForDuration()
When mapping a duration type to the database what is the preferred SQL type code to use?int
getPreferredSqlTypeCodeForInstant()
When mapping an instant type to the database what is the preferred SQL type code to use?int
getPreferredSqlTypeCodeForUuid()
When mapping an uuid type to the database what is the preferred SQL type code to use?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)
boolean
isLob()
Was LOB datatype requested for the given Java type?boolean
isNationalized()
Was nationalized character datatype requested for the given Java type?boolean
isPreferJavaTimeJdbcTypesEnabled()
boolean
isPreferNativeEnumTypesEnabled()
int
resolveJdbcTypeCode(int jdbcTypeCode)
Resolves the given type code to a possibly different type code, based on context.
-
-
-
Constructor Detail
-
DelegatingJdbcTypeIndicators
public DelegatingJdbcTypeIndicators(JdbcTypeIndicators delegate)
-
-
Method Detail
-
isNationalized
public boolean isNationalized()
Description copied from interface:JdbcTypeIndicators
Was nationalized character datatype requested for the given Java type?- Specified by:
isNationalized
in interfaceJdbcTypeIndicators
- Returns:
true
if nationalized character datatype should be used;false
otherwise.
-
isLob
public boolean isLob()
Description copied from interface:JdbcTypeIndicators
Was LOB datatype requested for the given Java type?- Specified by:
isLob
in interfaceJdbcTypeIndicators
- Returns:
true
if LOB datatype should be used;false
otherwise.
-
getEnumeratedType
public EnumType getEnumeratedType()
Description copied from interface:JdbcTypeIndicators
For enum mappings, what style of storage was requested (name vs. ordinal)?- Specified by:
getEnumeratedType
in interfaceJdbcTypeIndicators
- Returns:
- The enum type.
-
getTemporalPrecision
public TemporalType getTemporalPrecision()
Description copied from interface:JdbcTypeIndicators
For temporal type mappings, what precision was requested?- Specified by:
getTemporalPrecision
in interfaceJdbcTypeIndicators
-
isPreferJavaTimeJdbcTypesEnabled
public boolean isPreferJavaTimeJdbcTypesEnabled()
- Specified by:
isPreferJavaTimeJdbcTypesEnabled
in interfaceJdbcTypeIndicators
- See Also:
MappingSettings.JAVA_TIME_USE_DIRECT_JDBC
-
isPreferNativeEnumTypesEnabled
public boolean isPreferNativeEnumTypesEnabled()
- Specified by:
isPreferNativeEnumTypesEnabled
in interfaceJdbcTypeIndicators
- See Also:
MappingSettings.PREFER_NATIVE_ENUM_TYPES
-
getPreferredSqlTypeCodeForBoolean
public int getPreferredSqlTypeCodeForBoolean()
Description copied from interface:JdbcTypeIndicators
When mapping a boolean type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry
.- Specified by:
getPreferredSqlTypeCodeForBoolean
in interfaceJdbcTypeIndicators
- See Also:
MappingSettings.PREFERRED_BOOLEAN_JDBC_TYPE
,Dialect.getPreferredSqlTypeCodeForBoolean()
-
getPreferredSqlTypeCodeForDuration
public int getPreferredSqlTypeCodeForDuration()
Description copied from interface:JdbcTypeIndicators
When mapping a duration type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry
.- Specified by:
getPreferredSqlTypeCodeForDuration
in interfaceJdbcTypeIndicators
- See Also:
MappingSettings.PREFERRED_DURATION_JDBC_TYPE
-
getPreferredSqlTypeCodeForUuid
public int getPreferredSqlTypeCodeForUuid()
Description copied from interface:JdbcTypeIndicators
When mapping an uuid type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry
.- Specified by:
getPreferredSqlTypeCodeForUuid
in interfaceJdbcTypeIndicators
- See Also:
MappingSettings.PREFERRED_UUID_JDBC_TYPE
-
getPreferredSqlTypeCodeForInstant
public int getPreferredSqlTypeCodeForInstant()
Description copied from interface:JdbcTypeIndicators
When mapping an instant type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry
.- Specified by:
getPreferredSqlTypeCodeForInstant
in interfaceJdbcTypeIndicators
- See Also:
MappingSettings.PREFERRED_INSTANT_JDBC_TYPE
-
getPreferredSqlTypeCodeForArray
public int getPreferredSqlTypeCodeForArray()
Description copied from interface:JdbcTypeIndicators
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
.- Specified by:
getPreferredSqlTypeCodeForArray
in interfaceJdbcTypeIndicators
- See Also:
Dialect.getPreferredSqlTypeCodeForArray()
-
getColumnLength
public long getColumnLength()
Description copied from interface:JdbcTypeIndicators
Useful for resolutions based on column length.E.g. for choosing between a
VARCHAR
(String
) andCHAR(1)
(Character
/char
).- Specified by:
getColumnLength
in interfaceJdbcTypeIndicators
-
getColumnPrecision
public int getColumnPrecision()
Description copied from interface:JdbcTypeIndicators
Useful for resolutions based on column precision.- Specified by:
getColumnPrecision
in interfaceJdbcTypeIndicators
-
getColumnScale
public int getColumnScale()
Description copied from interface:JdbcTypeIndicators
Useful for resolutions based on column scale.E.g. for choosing between a
NUMERIC
andINTERVAL SECOND
.- Specified by:
getColumnScale
in interfaceJdbcTypeIndicators
-
getExplicitJdbcTypeCode
@Incubating public Integer getExplicitJdbcTypeCode()
Description copied from interface:JdbcTypeIndicators
Used (for now) only to choose a containerJdbcType
for SQL arrays.- Specified by:
getExplicitJdbcTypeCode
in interfaceJdbcTypeIndicators
-
getDefaultTimeZoneStorageStrategy
public TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
Description copied from interface:JdbcTypeIndicators
The defaultTimeZoneStorageStrategy
.- Specified by:
getDefaultTimeZoneStorageStrategy
in interfaceJdbcTypeIndicators
- See Also:
MappingSettings.TIMEZONE_DEFAULT_STORAGE
,Dialect.getTimeZoneSupport()
-
getJdbcType
public JdbcType getJdbcType(int jdbcTypeCode)
Description copied from interface:JdbcTypeIndicators
TheJdbcType
registered under the given type code with the associatedJdbcTypeRegistry
.- Specified by:
getJdbcType
in interfaceJdbcTypeIndicators
- Parameters:
jdbcTypeCode
- a type code fromSqlTypes
- Returns:
- the
JdbcType
registered under that type code
-
resolveJdbcTypeCode
public int resolveJdbcTypeCode(int jdbcTypeCode)
Description copied from interface:JdbcTypeIndicators
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.- Specified by:
resolveJdbcTypeCode
in interfaceJdbcTypeIndicators
- Parameters:
jdbcTypeCode
- a type code fromSqlTypes
- Returns:
- The jdbc type code to use
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
Description copied from interface:JdbcTypeIndicators
Provides access to theTypeConfiguration
for access to various type system related registries.- Specified by:
getTypeConfiguration
in interfaceJdbcTypeIndicators
-
getZonedTimeSqlType
public 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
public 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
public int getDefaultZonedTimeSqlType()
- Specified by:
getDefaultZonedTimeSqlType
in interfaceJdbcTypeIndicators
- 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
public int getDefaultZonedTimestampSqlType()
- Specified by:
getDefaultZonedTimestampSqlType
in interfaceJdbcTypeIndicators
- 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
public Dialect getDialect()
- Specified by:
getDialect
in interfaceJdbcTypeIndicators
-
-