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, SerializableJavaType, ShortJavaType, StringJavaType, TimeZoneJavaType, UrlJavaType, UUIDJavaType, YearJavaType, ZoneIdJavaType, ZoneOffsetJavaType

public abstract class AbstractClassJavaType<T> extends Object implements BasicJavaType<T>, Serializable
Abstract adapter for Java type descriptors.
See Also:
API Note:
This abstract descriptor implements BasicJavaType because we currently only categorize basic JavaTypes, where "basic" is meant in the sense of the JPA specification, that is, Type.PersistenceType.BASIC.
  • Constructor Details

    • 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

      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 Details

    • getMutabilityPlan

      public MutabilityPlan<T> getMutabilityPlan()
      Description copied from interface: JavaType
      Retrieve the mutability plan for this Java type.
      Specified by:
      getMutabilityPlan in interface JavaType<T>
    • getJavaType

      public Class<T> getJavaType()
      Description copied from interface: JavaType
      Get the Java type (a Type object) described by this JavaType.
      Specified by:
      getJavaType in interface JavaType<T>
      See Also:
    • getJavaTypeClass

      public Class<T> getJavaTypeClass()
      Description copied from interface: JavaType
      Get the Java type (the Class object) described by this JavaType.
      Specified by:
      getJavaTypeClass in interface JavaType<T>
      See Also:
    • extractHashCode

      public int extractHashCode(T value)
      Description copied from interface: JavaType
      Extract a proper hash code for the given value.
      Specified by:
      extractHashCode in interface JavaType<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
      Specified by:
      areEqual in interface JavaType<T>
      Parameters:
      one - One instance
      another - The other instance
      Returns:
      True if the two are considered equal; false otherwise.
    • getComparator

      public Comparator<T> getComparator()
      Description copied from interface: JavaType
      Retrieve the natural comparator for this type.
      Specified by:
      getComparator in interface JavaType<T>
    • extractLoggableRepresentation

      public String extractLoggableRepresentation(T value)
      Description copied from interface: JavaType
      Extract a loggable representation of the given value.
      Specified by:
      extractLoggableRepresentation in interface JavaType<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)