Class AbstractTimeZoneStorageCompositeUserType<T>

java.lang.Object
org.hibernate.usertype.internal.AbstractTimeZoneStorageCompositeUserType<T>
All Implemented Interfaces:
EmbeddableInstantiator, Instantiator, CompositeUserType<T>
Direct Known Subclasses:
OffsetDateTimeCompositeUserType, OffsetTimeCompositeUserType, ZonedDateTimeCompositeUserType

public abstract class AbstractTimeZoneStorageCompositeUserType<T> extends Object implements CompositeUserType<T>
  • Field Details

  • Constructor Details

    • AbstractTimeZoneStorageCompositeUserType

      public AbstractTimeZoneStorageCompositeUserType()
  • Method Details

    • equals

      public boolean equals(T x, T y)
      Description copied from interface: CompositeUserType
      Compare two instances of the class mapped by this type for persistence "equality". Equality of the persistent state.
      Specified by:
      equals in interface CompositeUserType<T>
    • hashCode

      public int hashCode(T x)
      Description copied from interface: CompositeUserType
      Get a hashcode for the instance, consistent with persistence "equality"
      Specified by:
      hashCode in interface CompositeUserType<T>
    • deepCopy

      public T deepCopy(T value)
      Description copied from interface: CompositeUserType
      Return a deep copy of the persistent state, stopping at entities and at collections. It is not necessary to copy immutable objects, or null values, in which case it is safe to simply return the argument.
      Specified by:
      deepCopy in interface CompositeUserType<T>
      Parameters:
      value - the object to be cloned, which may be null
      Returns:
      Object a copy
    • isMutable

      public boolean isMutable()
      Description copied from interface: CompositeUserType
      Are objects of this type mutable?
      Specified by:
      isMutable in interface CompositeUserType<T>
      Returns:
      boolean
    • disassemble

      public Serializable disassemble(T value)
      Description copied from interface: CompositeUserType
      Transform the object into its cacheable representation. At the very least this method should perform a deep copy if the type is mutable. That may not be enough for some implementations, however; for example, associations must be cached as identifier values. (optional operation)
      Specified by:
      disassemble in interface CompositeUserType<T>
      Parameters:
      value - the object to be cached
      Returns:
      a cacheable representation of the object
    • assemble

      public T assemble(Serializable cached, Object owner)
      Description copied from interface: CompositeUserType
      Reconstruct an object from the cacheable representation. At the very least this method should perform a deep copy if the type is mutable. (optional operation)
      Specified by:
      assemble in interface CompositeUserType<T>
      Parameters:
      cached - the object to be cached
      owner - the owner of the cached object
      Returns:
      a reconstructed object from the cacheable representation
    • replace

      public T replace(T detached, T managed, Object owner)
      Description copied from interface: CompositeUserType
      During merge, replace the existing (target) value in the entity we are merging to with a new (original) value from the detached entity we are merging. For immutable objects, or null values, it is safe to simply return the first parameter. For mutable objects, it is safe to return a copy of the first parameter. For objects with component values, it might make sense to recursively replace component values.
      Specified by:
      replace in interface CompositeUserType<T>
      Parameters:
      detached - the value from the detached entity being merged
      managed - the value in the managed entity
      Returns:
      the value to be merged