Class AbstractClassJavaType<T>
- java.lang.Object
-
- org.hibernate.type.descriptor.java.AbstractClassJavaType<T>
-
- All Implemented Interfaces:
Serializable
,BasicJavaType<T>
,JavaType<T>
- Direct Known Subclasses:
AbstractArrayJavaType
,AbstractTemporalJavaType
,BigDecimalJavaType
,BigIntegerJavaType
,BlobJavaType
,BooleanJavaType
,ByteArrayJavaType
,ByteJavaType
,CharacterArrayJavaType
,CharacterJavaType
,ClassJavaType
,ClobJavaType
,CollectionJavaType
,CurrencyJavaType
,DoubleJavaType
,DurationJavaType
,EmbeddableAggregateJavaType
,EntityJavaType
,EnumJavaType
,FloatJavaType
,InetAddressJavaType
,IntegerJavaType
,JavaTypeBasicAdaptor
,LocaleJavaType
,LongJavaType
,MapEntryJavaType
,NClobJavaType
,ObjectArrayJavaType
,ObjectJavaType
,PrimitiveByteArrayJavaType
,PrimitiveCharacterArrayJavaType
,RowVersionJavaType
,SerializableJavaType
,ShortJavaType
,StringJavaType
,TimeZoneJavaType
,UrlJavaType
,UUIDJavaType
,YearJavaType
,ZoneIdJavaType
,ZoneOffsetJavaType
public abstract class AbstractClassJavaType<T> extends Object implements BasicJavaType<T>, Serializable
Abstract adapter forJava type descriptors
.- See Also:
- Serialized Form
- API Note:
- This abstract descriptor implements
BasicJavaType
because we currently only categorize basicJavaType
s, where "basic" is meant in the sense of the JPA specification, that is,Type.PersistenceType.BASIC
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.type.descriptor.java.JavaType
JavaType.CoercionContext
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractClassJavaType(Class<? extends T> type)
Initialize a type descriptor for the given type.protected
AbstractClassJavaType(Class<? extends T> type, MutabilityPlan<? extends T> mutabilityPlan)
Initialize a type descriptor for the given type and mutability plan.protected
AbstractClassJavaType(Class<? extends T> type, MutabilityPlan<? extends T> mutabilityPlan, Comparator<? extends T> comparator)
Initialize a type descriptor for the given type, mutability plan and comparator.
-
Method Summary
All Methods Instance Methods Concrete 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 the given value.String
extractLoggableRepresentation(T value)
Extract a loggable representation of the given value.Comparator<T>
getComparator()
Retrieve the natural comparator for this type.Class<T>
getJavaType()
Get the Java type (aType
object) described by thisJavaType
.Class<T>
getJavaTypeClass()
Get the Java type (theClass
object) described by thisJavaType
.MutabilityPlan<T>
getMutabilityPlan()
Retrieve the mutability plan for this Java type.protected HibernateException
unknownUnwrap(Class<?> conversionType)
protected HibernateException
unknownWrap(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, getLongSqlLength, getReplacement, getTypeName, isInstance, isTemporalType, isWider, toString, unwrap, useObjectEqualsHashCode, wrap
-
-
-
-
Constructor Detail
-
AbstractClassJavaType
protected AbstractClassJavaType(Class<? extends T> type)
Initialize a type descriptor for the given type. Assumed immutable.- Parameters:
type
- The Java type.- See Also:
AbstractClassJavaType(Class, MutabilityPlan)
-
AbstractClassJavaType
protected AbstractClassJavaType(Class<? extends T> type, MutabilityPlan<? extends T> mutabilityPlan)
Initialize a type descriptor for the given type and mutability plan.- Parameters:
type
- The Java type.mutabilityPlan
- The plan for handling mutability aspects of the java type.
-
AbstractClassJavaType
protected AbstractClassJavaType(Class<? extends T> type, MutabilityPlan<? extends T> mutabilityPlan, Comparator<? extends T> comparator)
Initialize a type descriptor for the given type, mutability plan and comparator.- Parameters:
type
- The Java type.mutabilityPlan
- The plan for handling mutability aspects of the java type.comparator
- The comparator for handling comparison of values
-
-
Method Detail
-
getMutabilityPlan
public MutabilityPlan<T> getMutabilityPlan()
Description copied from interface:JavaType
Retrieve the mutability plan for this Java type.- Specified by:
getMutabilityPlan
in interfaceJavaType<T>
-
getJavaType
public Class<T> getJavaType()
Description copied from interface:JavaType
Get the Java type (aType
object) described by thisJavaType
.- Specified by:
getJavaType
in interfaceJavaType<T>
- See Also:
JavaType.getJavaTypeClass()
-
getJavaTypeClass
public Class<T> getJavaTypeClass()
Description copied from interface:JavaType
Get the Java type (theClass
object) described by thisJavaType
.- Specified by:
getJavaTypeClass
in interfaceJavaType<T>
- See Also:
JavaType.getJavaType()
-
extractHashCode
public int extractHashCode(T value)
Description copied from interface:JavaType
Extract a proper hash code for the given value.- Specified by:
extractHashCode
in 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:JavaType
Determine if two instances are equal
-
getComparator
public Comparator<T> getComparator()
Description copied from interface:JavaType
Retrieve the natural comparator for this type.- Specified by:
getComparator
in interfaceJavaType<T>
-
extractLoggableRepresentation
public String extractLoggableRepresentation(T value)
Description copied from interface:JavaType
Extract a loggable representation of the given value.- Specified by:
extractLoggableRepresentation
in 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)
-
-