Class AbstractJavaType<T>
- java.lang.Object
-
- org.hibernate.type.descriptor.java.AbstractJavaType<T>
-
- All Implemented Interfaces:
Serializable,BasicJavaType<T>,JavaType<T>
- Direct Known Subclasses:
BasicCollectionJavaType,FormatMapperBasedJavaType,GeolatteGeometryJavaType,JTSGeometryJavaType,UnknownBasicJavaType
public abstract class AbstractJavaType<T> extends Object implements BasicJavaType<T>, Serializable
Abstract adapter for Java type descriptors.- See Also:
- Serialized Form
- API Note:
- This abstract descriptor implements BasicJavaType
because we currently only categorize "basic" JavaTypes,
as in the
Type.PersistenceType.BASICsense
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.type.descriptor.java.JavaType
JavaType.CoercionContext
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractJavaType(Type type)Initialize a type descriptor for the given type.protectedAbstractJavaType(Type type, MutabilityPlan<T> mutabilityPlan)Initialize a type descriptor for the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareEqual(T one, T another)Determine if two instances are equalintextractHashCode(T value)Extract a proper hash code for the given value.StringextractLoggableRepresentation(T value)Extract a loggable representation of the given value.Comparator<T>getComparator()Retrieve the natural comparator for this type.TypegetJavaType()Get the Java type (aTypeobject) described by thisJavaType.MutabilityPlan<T>getMutabilityPlan()Retrieve the mutability plan for this Java type.protected HibernateExceptionunknownUnwrap(Class<?> conversionType)protected HibernateExceptionunknownWrap(Class<?> conversionType)-
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.BasicJavaType
fromString, getRecommendedJdbcType
-
Methods inherited from interface org.hibernate.type.descriptor.java.JavaType
appendEncodedString, coerce, createJavaType, createJavaType, fromEncodedString, getCheckCondition, getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getDefaultValue, getJavaTypeClass, getLongSqlLength, getReplacement, getTypeName, isInstance, isTemporalType, isWider, toString, unwrap, useObjectEqualsHashCode, wrap
-
-
-
-
Constructor Detail
-
AbstractJavaType
protected AbstractJavaType(Type type)
Initialize a type descriptor for the given type. Assumed immutable.- Parameters:
type- The Java type.- See Also:
AbstractJavaType(Type, MutabilityPlan)
-
AbstractJavaType
protected AbstractJavaType(Type type, MutabilityPlan<T> mutabilityPlan)
Initialize a type descriptor for the given type. Assumed immutable.- Parameters:
type- The Java type.mutabilityPlan- The plan for handling mutability aspects of the java type.
-
-
Method Detail
-
getMutabilityPlan
public MutabilityPlan<T> getMutabilityPlan()
Description copied from interface:JavaTypeRetrieve the mutability plan for this Java type.- Specified by:
getMutabilityPlanin interfaceJavaType<T>
-
getJavaType
public Type getJavaType()
Description copied from interface:JavaTypeGet the Java type (aTypeobject) described by thisJavaType.- Specified by:
getJavaTypein interfaceJavaType<T>- See Also:
JavaType.getJavaTypeClass()
-
extractHashCode
public int extractHashCode(T value)
Description copied from interface:JavaTypeExtract a proper hash code for the given value.- Specified by:
extractHashCodein interfaceJavaType<T>- Parameters:
value- The value for which to extract a hash code.- Returns:
- The extracted hash code.
-
areEqual
public boolean areEqual(T one, T another)
Description copied from interface:JavaTypeDetermine if two instances are equal
-
getComparator
public Comparator<T> getComparator()
Description copied from interface:JavaTypeRetrieve the natural comparator for this type.- Specified by:
getComparatorin interfaceJavaType<T>
-
extractLoggableRepresentation
public String extractLoggableRepresentation(T value)
Description copied from interface:JavaTypeExtract a loggable representation of the given value.- Specified by:
extractLoggableRepresentationin interfaceJavaType<T>- Parameters:
value- The value for which to extract a loggable representation.- Returns:
- The loggable representation
-
unknownUnwrap
protected HibernateException unknownUnwrap(Class<?> conversionType)
-
unknownWrap
protected HibernateException unknownWrap(Class<?> conversionType)
-
-