Class SerializableJavaType<T extends Serializable>
java.lang.Object
org.hibernate.type.descriptor.java.AbstractClassJavaType<T>
org.hibernate.type.descriptor.java.SerializableJavaType<T>
- All Implemented Interfaces:
Serializable, BasicJavaType<T>, JavaType<T>
Descriptor for general
Serializable handling.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from interface JavaType
JavaType.CoercionContext -
Constructor Summary
ConstructorsConstructorDescriptionSerializableJavaType(Class<T> type) SerializableJavaType(Class<T> type, MutabilityPlan<T> mutabilityPlan) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine if two instances are equalintextractHashCode(T value) Extract a proper hash code for the given value.protected TfromBytes(byte[] bytes) fromString(CharSequence string) getRecommendedJdbcType(JdbcTypeIndicators indicators) Obtain the "recommended" SQL type descriptor for this Java type.protected byte[]<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 AbstractClassJavaType
extractLoggableRepresentation, getComparator, getJavaType, getJavaTypeClass, getMutabilityPlan, 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, getLongSqlLength, getReplacement, getTypeName, isInstance, isTemporalType, isWider, useObjectEqualsHashCode
-
Constructor Details
-
SerializableJavaType
-
SerializableJavaType
-
-
Method Details
-
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.- Parameters:
indicators- Contextual information- Returns:
- The recommended SQL type descriptor
-
toString
-
fromString
-
areEqual
Description copied from interface:JavaTypeDetermine if two instances are equal- Specified by:
areEqualin interfaceJavaType<T extends Serializable>- Overrides:
areEqualin classAbstractClassJavaType<T extends Serializable>- Parameters:
one- One instanceanother- The other instance- Returns:
- True if the two are considered equal; false otherwise.
-
extractHashCode
Description copied from interface:JavaTypeExtract a proper hash code for the given value.- Specified by:
extractHashCodein interfaceJavaType<T extends Serializable>- Overrides:
extractHashCodein classAbstractClassJavaType<T extends Serializable>- Parameters:
value- The value for which to extract a hash code.- Returns:
- The extracted hash code.
-
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.- Type Parameters:
X- The conversion type.- Parameters:
value- The value to unwraptype- The type as which to unwrapoptions- The options- Returns:
- The unwrapped value.
-
wrap
-
toBytes
-
fromBytes
-