org.hibernate.type
Class ImmutableType
- Serializable, Type
public abstract class ImmutableType
Superclass of nullable immutable types.
Object | deepCopy(Object value, EntityMode entityMode, SessionFactoryImplementor factory) - Return a deep copy of the persistent state, stopping at entities and at
collections.
|
boolean | isMutable() - Are objects of this type mutable.
|
Object | replace(Object original, Object target, SessionImplementor session, Object owner, Map copyCache) - 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.
|
fromStringValue , fromXMLNode , fromXMLString , get , getColumnSpan , isDirty , isEqual , isEqual , nullSafeGet , nullSafeGet , nullSafeGet , nullSafeGet , nullSafeSet , nullSafeSet , nullSafeSet , nullSafeToString , set , setToXMLNode , sqlType , sqlTypes , toColumnNullness , toLoggableString , toString , toXMLString |
assemble , beforeAssemble , compare , disassemble , getHashCode , getHashCode , getSemiResolvedType , hydrate , isAnyType , isAssociationType , isCollectionType , isComponentType , isDirty , isEntityType , isEqual , isEqual , isModified , isSame , isXMLElement , replace , replaceNode , resolve , semiResolve |
deepCopy
public final Object deepCopy(Object value,
EntityMode entityMode,
SessionFactoryImplementor factory)
Return a deep copy of the persistent state, stopping at entities and at
collections.
- deepCopy in interface Type
value
- generally a collection element or entity fieldentityMode
- factory
-
isMutable
public final boolean isMutable()
Are objects of this type mutable. (With respect to the referencing object ...
entities and collections are considered immutable because they manage their
own internal state.)
- isMutable in interface Type
replace
public Object replace(Object original,
Object target,
SessionImplementor session,
Object owner,
Map copyCache)
throws HibernateException
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.
- replace in interface Type
original
- the value from the detached entity being mergedtarget
- the value in the managed entity