Class AbstractTypeDescriptor<T>
- java.lang.Object
-
- org.hibernate.type.descriptor.java.AbstractTypeDescriptor<T>
-
- All Implemented Interfaces:
java.io.Serializable
,BasicJavaDescriptor<T>
,JavaTypeDescriptor<T>
- Direct Known Subclasses:
BigDecimalTypeDescriptor
,BigIntegerTypeDescriptor
,BlobTypeDescriptor
,BooleanTypeDescriptor
,ByteArrayTypeDescriptor
,ByteTypeDescriptor
,CalendarDateTypeDescriptor
,CalendarTimeTypeDescriptor
,CalendarTypeDescriptor
,CharacterArrayTypeDescriptor
,CharacterTypeDescriptor
,ClassTypeDescriptor
,ClobTypeDescriptor
,CurrencyTypeDescriptor
,DateTypeDescriptor
,DoubleTypeDescriptor
,DurationJavaDescriptor
,EnumJavaTypeDescriptor
,FloatTypeDescriptor
,InstantJavaDescriptor
,IntegerTypeDescriptor
,JavaTypeDescriptorRegistry.FallbackJavaTypeDescriptor
,JdbcDateTypeDescriptor
,JdbcTimestampTypeDescriptor
,JdbcTimeTypeDescriptor
,LocalDateJavaDescriptor
,LocalDateTimeJavaDescriptor
,LocaleTypeDescriptor
,LocalTimeJavaDescriptor
,LongTypeDescriptor
,NClobTypeDescriptor
,OffsetDateTimeJavaDescriptor
,OffsetTimeJavaDescriptor
,PrimitiveByteArrayTypeDescriptor
,PrimitiveCharacterArrayTypeDescriptor
,RowVersionTypeDescriptor
,SerializableTypeDescriptor
,ShortTypeDescriptor
,StringTypeDescriptor
,TimeZoneTypeDescriptor
,UrlTypeDescriptor
,UUIDTypeDescriptor
,ZonedDateTimeJavaDescriptor
public abstract class AbstractTypeDescriptor<T> extends java.lang.Object implements BasicJavaDescriptor<T>, java.io.Serializable
Abstract adapter for Java type descriptors.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTypeDescriptor(java.lang.Class<T> type)
Initialize a type descriptor for the given type.protected
AbstractTypeDescriptor(java.lang.Class<T> type, MutabilityPlan<T> mutabilityPlan)
Initialize a type descriptor for the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
areEqual(T one, T another)
Determine if two instances are equalint
extractHashCode(T value)
Extract a proper hash code for this value.java.lang.String
extractLoggableRepresentation(T value)
Extract a loggable representation of the value.java.util.Comparator<T>
getComparator()
Retrieve the natural comparator for this type.java.lang.Class<T>
getJavaType()
Get the Java type describedjava.lang.Class<T>
getJavaTypeClass()
Deprecated.UsegetJavaType()
insteadMutabilityPlan<T>
getMutabilityPlan()
Retrieve the mutability plan for this Java type.protected HibernateException
unknownUnwrap(java.lang.Class conversionType)
protected HibernateException
unknownWrap(java.lang.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.BasicJavaDescriptor
getJdbcRecommendedSqlType
-
Methods inherited from interface org.hibernate.type.descriptor.java.JavaTypeDescriptor
fromString, toString, unwrap, wrap
-
-
-
-
Constructor Detail
-
AbstractTypeDescriptor
protected AbstractTypeDescriptor(java.lang.Class<T> type)
Initialize a type descriptor for the given type. Assumed immutable.- Parameters:
type
- The Java type.- See Also:
AbstractTypeDescriptor(Class, MutabilityPlan)
-
AbstractTypeDescriptor
protected AbstractTypeDescriptor(java.lang.Class<T> 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:JavaTypeDescriptor
Retrieve the mutability plan for this Java type.- Specified by:
getMutabilityPlan
in interfaceJavaTypeDescriptor<T>
-
getJavaType
public java.lang.Class<T> getJavaType()
Description copied from interface:JavaTypeDescriptor
Get the Java type described- Specified by:
getJavaType
in interfaceJavaTypeDescriptor<T>
-
getJavaTypeClass
@Deprecated public java.lang.Class<T> getJavaTypeClass()
Deprecated.UsegetJavaType()
insteadDescription copied from interface:JavaTypeDescriptor
Retrieve the Java type handled here.- Specified by:
getJavaTypeClass
in interfaceJavaTypeDescriptor<T>
- Returns:
- The Java type.
-
extractHashCode
public int extractHashCode(T value)
Description copied from interface:JavaTypeDescriptor
Extract a proper hash code for this value.- Specified by:
extractHashCode
in interfaceJavaTypeDescriptor<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:JavaTypeDescriptor
Determine if two instances are equal- Specified by:
areEqual
in interfaceJavaTypeDescriptor<T>
- Parameters:
one
- One instanceanother
- The other instance- Returns:
- True if the two are considered equal; false otherwise.
-
getComparator
public java.util.Comparator<T> getComparator()
Description copied from interface:JavaTypeDescriptor
Retrieve the natural comparator for this type.- Specified by:
getComparator
in interfaceJavaTypeDescriptor<T>
-
extractLoggableRepresentation
public java.lang.String extractLoggableRepresentation(T value)
Description copied from interface:JavaTypeDescriptor
Extract a loggable representation of the value.- Specified by:
extractLoggableRepresentation
in interfaceJavaTypeDescriptor<T>
- Parameters:
value
- The value for which to extract a loggable representation.- Returns:
- The loggable representation
-
unknownUnwrap
protected HibernateException unknownUnwrap(java.lang.Class conversionType)
-
unknownWrap
protected HibernateException unknownWrap(java.lang.Class conversionType)
-
-