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 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 FormatMappergetFormatMapper(TypeConfiguration typeConfiguration) Retrieve the mutability plan for this Java type.getRecommendedJdbcType(JdbcTypeIndicators context) Obtain the "recommended" SQL type descriptor for this Java type.booleanCan the internal state of instances ofTbe changed?<X> Xunwrap(T value, Class<X> type, WrapperOptions options) Unwrap an instance of our handled Java type into the requested type.<X> Twrap(X value, WrapperOptions options) Wrap a value as our handled Java type.Methods inherited from class AbstractJavaType
areEqual, extractHashCode, extractLoggableRepresentation, getComparator, getJavaType, unknownUnwrap, unknownWrapMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface JavaType
appendEncodedString, cast, coerce, createJavaType, fromEncodedString, 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:BasicJavaTypeObtain the "recommended" SQL type descriptor for this Java type. Often, but not always, the source of this recommendation is the JDBC specification.- Specified by:
getRecommendedJdbcTypein interfaceBasicJavaType<T>- Specified by:
getRecommendedJdbcTypein interfaceJavaType<T>- Parameters:
context- Contextual information- Returns:
- The recommended SQL type descriptor
-
toString
-
fromString
- Specified by:
fromStringin interfaceBasicJavaType<T>- Specified by:
fromStringin interfaceJavaType<T>
-
unwrap
Description copied from interface:JavaTypeUnwrap 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 valueas aLong, we would return something likeLong.valueOf( value.longValue() ).Intended use is during
PreparedStatementbinding. -
wrap
-
getMutabilityPlan
Description copied from interface:JavaTypeRetrieve the mutability plan for this Java type.- Specified by:
getMutabilityPlanin interfaceJavaType<T>- Overrides:
getMutabilityPlanin classAbstractJavaType<T>
-
isMutable
public boolean isMutable()Description copied from interface:MutabilityPlanCan the internal state of instances ofTbe changed?- Specified by:
isMutablein interfaceMutabilityPlan<T>- Returns:
- True if the internal state can be changed; false otherwise.
-
deepCopy
Description copied from interface:MutabilityPlanReturn a deep copy of the value.- Specified by:
deepCopyin interfaceMutabilityPlan<T>- Parameters:
value- The value to deep copy- Returns:
- The deep copy.
-