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>
- Author:
- Christian Beikov
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassemble(Serializable cached, Object owner) Reconstruct an object from the cacheable representation.Return a deep copy of the persistent state, stopping at entities and at collections.disassemble(T value) Transform the object into its cacheable representation.booleanCompare two instances of the class mapped by this type for persistence "equality".intGet a hashcode for the instance, consistent with persistence "equality"booleanAre objects of this type mutable?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, waitMethods inherited from interface org.hibernate.usertype.CompositeUserType
embeddable, getPropertyValue, instantiate, isInstance, isSameClass, returnedClass
-
Field Details
-
INSTANT_NAME
- See Also:
-
ZONE_OFFSET_NAME
- See Also:
-
-
Constructor Details
-
AbstractTimeZoneStorageCompositeUserType
public AbstractTimeZoneStorageCompositeUserType()
-
-
Method Details
-
equals
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
Description copied from interface:CompositeUserTypeGet a hashcode for the instance, consistent with persistence "equality"- Specified by:
hashCodein interfaceCompositeUserType<T>
-
deepCopy
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
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
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
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
-