Package org.hibernate.usertype.internal
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 Summary
Fields Modifier and Type Field Description static StringINSTANT_NAMEstatic StringZONE_OFFSET_NAME
-
Constructor Summary
Constructors Constructor Description AbstractTimeZoneStorageCompositeUserType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tassemble(Serializable cached, Object owner)Reconstruct an object from the cacheable representation.TdeepCopy(T value)Return a deep copy of the persistent state, stopping at entities and at collections.Serializabledisassemble(T value)Transform the object into its cacheable representation.booleanequals(T x, T y)Compare two instances of the class mapped by this type for persistence "equality".inthashCode(T x)Get a hashcode for the instance, consistent with persistence "equality"booleanisMutable()Are objects of this type mutable?Treplace(T detached, T managed, Object owner)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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.usertype.CompositeUserType
embeddable, getPropertyValue, instantiate, isInstance, isSameClass, returnedClass
-
-
-
-
Field Detail
-
INSTANT_NAME
public static final String INSTANT_NAME
- See Also:
- Constant Field Values
-
ZONE_OFFSET_NAME
public static final String ZONE_OFFSET_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
equals
public boolean equals(T x, T y)
Description copied from interface:CompositeUserTypeCompare two instances of the class mapped by this type for persistence "equality". Equality of the persistent state.- Specified by:
equalsin interfaceCompositeUserType<T>
-
hashCode
public int hashCode(T x)
Description copied from interface:CompositeUserTypeGet a hashcode for the instance, consistent with persistence "equality"- Specified by:
hashCodein interfaceCompositeUserType<T>
-
deepCopy
public T deepCopy(T value)
Description copied from interface:CompositeUserTypeReturn 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:
deepCopyin interfaceCompositeUserType<T>- Parameters:
value- the object to be cloned, which may be null- Returns:
- Object a copy
-
isMutable
public boolean isMutable()
Description copied from interface:CompositeUserTypeAre objects of this type mutable?- Specified by:
isMutablein interfaceCompositeUserType<T>- Returns:
- boolean
-
disassemble
public Serializable disassemble(T value)
Description copied from interface:CompositeUserTypeTransform 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:
disassemblein interfaceCompositeUserType<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:CompositeUserTypeReconstruct 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:
assemblein interfaceCompositeUserType<T>- Parameters:
cached- the object to be cachedowner- 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:CompositeUserTypeDuring 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:
replacein interfaceCompositeUserType<T>- Parameters:
detached- the value from the detached entity being mergedmanaged- the value in the managed entity- Returns:
- the value to be merged
-
-