Package org.hibernate.type.internal
Class UserTypeJavaTypeWrapper<J>
java.lang.Object
org.hibernate.type.internal.UserTypeJavaTypeWrapper<J>
- All Implemented Interfaces:
Serializable
,BasicJavaType<J>
,JavaType<J>
- Direct Known Subclasses:
UserTypeVersionJavaTypeWrapper
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.hibernate.type.descriptor.java.JavaType
JavaType.CoercionContext
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine if two instances are equalint
extractHashCode
(J value) Extract a proper hash code for the given value.fromString
(CharSequence string) Retrieve the natural comparator for this type.long
getDefaultSqlLength
(Dialect dialect, JdbcType jdbcType) The default column length when this Java type is mapped to a SQL data type which is parametrized by length, for exampleTypes.VARCHAR
.int
getDefaultSqlPrecision
(Dialect dialect, JdbcType jdbcType) The default column precision when this Java type is mapped to a SQL data type which is parametrized by precision, for exampleTypes.DECIMAL
.int
getDefaultSqlScale
(Dialect dialect, JdbcType jdbcType) The default column scale when this Java type is mapped to a SQL data type which is parametrized by scale, for exampleTypes.DECIMAL
.Get the Java type (theClass
object) described by thisJavaType
.Retrieve the mutability plan for this Java type.getRecommendedJdbcType
(JdbcTypeIndicators context) Obtain the "recommended"SQL type descriptor
for this Java type.<X> X
unwrap
(J value, Class<X> type, WrapperOptions options) Unwrap an instance of our handled Java type into the requested type.<X> J
wrap
(X value, WrapperOptions options) Wrap a value as our handled Java type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.type.descriptor.java.JavaType
appendEncodedString, coerce, createJavaType, extractLoggableRepresentation, fromEncodedString, getCheckCondition, getDefaultValue, getJavaType, getLongSqlLength, getReplacement, getTypeName, isInstance, isTemporalType, isWider, useObjectEqualsHashCode
-
Field Details
-
userType
-
-
Constructor Details
-
UserTypeJavaTypeWrapper
-
-
Method Details
-
getMutabilityPlan
Description copied from interface:JavaType
Retrieve the mutability plan for this Java type.- Specified by:
getMutabilityPlan
in interfaceJavaType<J>
-
getRecommendedJdbcType
Description copied from interface:BasicJavaType
Obtain the "recommended"SQL type descriptor
for this Java type. Often, but not always, the source of this recommendation is the JDBC specification.- Specified by:
getRecommendedJdbcType
in interfaceBasicJavaType<J>
- Specified by:
getRecommendedJdbcType
in interfaceJavaType<J>
- Parameters:
context
- Contextual information- Returns:
- The recommended SQL type descriptor
-
getDefaultSqlLength
Description copied from interface:JavaType
The default column length when this Java type is mapped to a SQL data type which is parametrized by length, for exampleTypes.VARCHAR
.- Specified by:
getDefaultSqlLength
in interfaceJavaType<J>
- Returns:
Size.DEFAULT_LENGTH
unless overridden
-
getDefaultSqlPrecision
Description copied from interface:JavaType
The default column precision when this Java type is mapped to a SQL data type which is parametrized by precision, for exampleTypes.DECIMAL
.- Specified by:
getDefaultSqlPrecision
in interfaceJavaType<J>
- Returns:
Size.DEFAULT_PRECISION
unless overridden
-
getDefaultSqlScale
Description copied from interface:JavaType
The default column scale when this Java type is mapped to a SQL data type which is parametrized by scale, for exampleTypes.DECIMAL
.- Specified by:
getDefaultSqlScale
in interfaceJavaType<J>
- Returns:
Size.DEFAULT_SCALE
unless overridden
-
getComparator
Description copied from interface:JavaType
Retrieve the natural comparator for this type.- Specified by:
getComparator
in interfaceJavaType<J>
-
extractHashCode
Description copied from interface:JavaType
Extract a proper hash code for the given value.- Specified by:
extractHashCode
in interfaceJavaType<J>
- Parameters:
value
- The value for which to extract a hash code.- Returns:
- The extracted hash code.
-
areEqual
Description copied from interface:JavaType
Determine if two instances are equal -
fromString
- Specified by:
fromString
in interfaceBasicJavaType<J>
- Specified by:
fromString
in interfaceJavaType<J>
-
toString
-
unwrap
Description copied from interface:JavaType
Unwrap an instance of our handled Java type into the requested type.As an example, if this is a
JavaType<Integer>
and we are asked to unwrap theInteger value
as aLong
, we would return something likeLong.valueOf( value.longValue() )
.Intended use is during
PreparedStatement
binding. -
wrap
Description copied from interface:JavaType
Wrap a value as our handled Java type.Intended use is during
ResultSet
extraction. -
getJavaTypeClass
Description copied from interface:JavaType
Get the Java type (theClass
object) described by thisJavaType
.- Specified by:
getJavaTypeClass
in interfaceJavaType<J>
- See Also:
-