Class FormatMapperBasedJavaType<T>
java.lang.Object
org.hibernate.type.descriptor.java.AbstractJavaType<T>
org.hibernate.type.descriptor.java.spi.FormatMapperBasedJavaType<T>
- All Implemented Interfaces:
Serializable
,BasicJavaType<T>
,JavaType<T>
,MutabilityPlan<T>
- Direct Known Subclasses:
JsonJavaType
,XmlJavaType
@Incubating
public abstract class FormatMapperBasedJavaType<T>
extends AbstractJavaType<T>
implements MutabilityPlan<T>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.type.descriptor.java.JavaType
JavaType.CoercionContext
-
Constructor Summary
ConstructorsConstructorDescriptionFormatMapperBasedJavaType
(Type type, MutabilityPlan<T> mutabilityPlan, TypeConfiguration typeConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionassemble
(Serializable cached, SharedSessionContract session) Assemble a previously disassembled value.Return a deep copy of the value.disassemble
(T value, SharedSessionContract session) Return a disassembled representation of the value.fromString
(CharSequence string) protected abstract FormatMapper
getFormatMapper
(TypeConfiguration typeConfiguration) Retrieve the mutability plan for this Java type.getRecommendedJdbcType
(JdbcTypeIndicators context) Obtain the "recommended"SQL type descriptor
for this Java type.boolean
Can the internal state of instances ofT
be changed?<X> X
unwrap
(T value, Class<X> type, WrapperOptions options) Unwrap an instance of our handled Java type into the requested type.<X> T
wrap
(X value, WrapperOptions options) Wrap a value as our handled Java type.Methods inherited from class org.hibernate.type.descriptor.java.AbstractJavaType
areEqual, extractHashCode, extractLoggableRepresentation, getComparator, getJavaType, unknownUnwrap, unknownWrap
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, fromEncodedString, getCheckCondition, getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getDefaultValue, getJavaTypeClass, getLongSqlLength, getReplacement, getTypeName, isInstance, isTemporalType, isWider, useObjectEqualsHashCode
-
Constructor Details
-
FormatMapperBasedJavaType
public FormatMapperBasedJavaType(Type type, MutabilityPlan<T> mutabilityPlan, TypeConfiguration typeConfiguration)
-
-
Method Details
-
getFormatMapper
-
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<T>
- Specified by:
getRecommendedJdbcType
in interfaceJavaType<T>
- Parameters:
context
- Contextual information- Returns:
- The recommended SQL type descriptor
-
toString
-
fromString
- Specified by:
fromString
in interfaceBasicJavaType<T>
- Specified by:
fromString
in interfaceJavaType<T>
-
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. -
getMutabilityPlan
Description copied from interface:JavaType
Retrieve the mutability plan for this Java type.- Specified by:
getMutabilityPlan
in interfaceJavaType<T>
- Overrides:
getMutabilityPlan
in classAbstractJavaType<T>
-
isMutable
public boolean isMutable()Description copied from interface:MutabilityPlan
Can the internal state of instances ofT
be changed?- Specified by:
isMutable
in interfaceMutabilityPlan<T>
- Returns:
- True if the internal state can be changed; false otherwise.
-
deepCopy
Description copied from interface:MutabilityPlan
Return a deep copy of the value.- Specified by:
deepCopy
in interfaceMutabilityPlan<T>
- Parameters:
value
- The value to deep copy- Returns:
- The deep copy.
-