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 -
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.boolean
Compare two instances of the class mapped by this type for persistence "equality".int
Get a hashcode for the instance, consistent with persistence "equality"boolean
Are 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, wait
Methods 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:CompositeUserType
Compare two instances of the class mapped by this type for persistence "equality". Equality of the persistent state.- Specified by:
equals
in interfaceCompositeUserType<T>
-
hashCode
Description copied from interface:CompositeUserType
Get a hashcode for the instance, consistent with persistence "equality"- Specified by:
hashCode
in interfaceCompositeUserType<T>
-
deepCopy
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 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:CompositeUserType
Are objects of this type mutable?- Specified by:
isMutable
in interfaceCompositeUserType<T>
- Returns:
- boolean
-
disassemble
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 interfaceCompositeUserType<T>
- Parameters:
value
- the object to be cached- Returns:
- a cacheable representation of the object
-
assemble
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 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: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 interfaceCompositeUserType<T>
- Parameters:
detached
- the value from the detached entity being mergedmanaged
- the value in the managed entity- Returns:
- the value to be merged
-