Package org.hibernate.type
Interface Type
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
AssociationType
,BasicType
,CompositeType
,DiscriminatorType<T>
,IdentifierType<T>
,SingleColumnType<T>
,VersionType<T>
- All Known Implementing Classes:
AbstractSingleColumnStandardBasicType
,AbstractStandardBasicType
,AbstractType
,AdaptedImmutableType
,AnyType
,ArrayType
,AttributeConverterTypeAdapter
,BagType
,BigDecimalType
,BigIntegerType
,BinaryType
,BlobType
,BooleanType
,ByteType
,CalendarDateType
,CalendarTimeType
,CalendarType
,CharacterArrayClobType
,CharacterArrayNClobType
,CharacterArrayType
,CharacterNCharType
,CharacterType
,CharArrayType
,ClassType
,ClobType
,CollectionType
,ComponentType
,CompositeCustomType
,CurrencyType
,CustomCollectionType
,CustomType
,DateType
,DbTimestampType
,DiscriminatorType
,DoubleType
,DurationType
,EmbeddedComponentType
,EntityType
,FloatType
,GeolatteGeometryType
,IdentifierBagType
,ImageType
,InstantType
,IntegerType
,JTSGeometryType
,ListType
,LocalDateTimeType
,LocalDateType
,LocaleType
,LocalTimeType
,LongType
,ManyToOneType
,MapType
,MaterializedBlobType
,MaterializedClobType
,MaterializedNClobType
,MetaType
,NClobType
,NTextType
,NumericBooleanType
,ObjectType
,OffsetDateTimeType
,OffsetTimeType
,OneToOneType
,OrderedMapType
,OrderedSetType
,PostgresUUIDType
,PrimitiveCharacterArrayClobType
,PrimitiveCharacterArrayNClobType
,RowVersionType
,SerializableToBlobType
,SerializableType
,SetType
,ShortType
,SortedMapType
,SortedSetType
,SpecialOneToOneType
,StandardBasicTypeTemplate
,StringNVarcharType
,StringType
,TextType
,TimestampType
,TimeType
,TimeZoneType
,TrueFalseType
,UrlType
,UUIDBinaryType
,UUIDCharType
,WrappedMaterializedBlobType
,WrapperBinaryType
,YesNoType
,ZonedDateTimeType
public interface Type extends java.io.Serializable
Defines a mapping between a Java type and one or more JDBC types, as well as describing the in-memory semantics of the given java type (how do we check it for 'dirtiness', how do we copy values, etc). Application developers needing custom types can implement this interface (either directly or via subclassing an existing impl) or by the (slightly more stable, though more limited)UserType
interface. Implementations of this interface must certainly be thread-safe. It is recommended that they be immutable as well, though that is difficult to achieve completely given the no-arg constructor requirement for custom types.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.Object
assemble(java.io.Serializable cached, SharedSessionContractImplementor session, java.lang.Object owner)
Reconstruct the object from its disassembled state.void
beforeAssemble(java.io.Serializable cached, SharedSessionContractImplementor session)
Called before assembling a query result set from the query cache, to allow batch fetching of entities missing from the second-level cache.int
compare(java.lang.Object x, java.lang.Object y)
Perform aComparator
style comparison between valuesjava.lang.Object
deepCopy(java.lang.Object value, SessionFactoryImplementor factory)
Return a deep copy of the persistent state, stopping at entities and at collections.Size[]
defaultSizes(Mapping mapping)
Defines the column sizes to use according to this type if the user did not explicitly say (and if nodictatedSizes(org.hibernate.engine.spi.Mapping)
were given).Size[]
dictatedSizes(Mapping mapping)
Return the column sizes dictated by this type.java.io.Serializable
disassemble(java.lang.Object value, SharedSessionContractImplementor session, java.lang.Object owner)
Return a disassembled representation of the object.int
getColumnSpan(Mapping mapping)
How many columns are used to persist this type.int
getHashCode(java.lang.Object x)
Get a hash code, consistent with persistence "equality".int
getHashCode(java.lang.Object x, SessionFactoryImplementor factory)
Get a hash code, consistent with persistence "equality".java.lang.String
getName()
Returns the abbreviated name of the type.java.lang.Class
getReturnedClass()
Type
getSemiResolvedType(SessionFactoryImplementor factory)
As part of 2-phase loading, when we perform resolving what is the resolved type for this type? Generally speaking the type and its semi-resolved type will be the same.java.lang.Object
hydrate(java.sql.ResultSet rs, java.lang.String[] names, SharedSessionContractImplementor session, java.lang.Object owner)
Extract a value from the JDBC result set.boolean
isAnyType()
Return true if the implementation is castable toAnyType
.boolean
isAssociationType()
Return true if the implementation is castable toAssociationType
.boolean
isCollectionType()
Return true if the implementation is castable toCollectionType
.boolean
isComponentType()
Return true if the implementation is castable toCompositeType
.boolean
isDirty(java.lang.Object oldState, java.lang.Object currentState, boolean[] checkable, SharedSessionContractImplementor session)
Should the parent be considered dirty, given both the old and current value?boolean
isDirty(java.lang.Object old, java.lang.Object current, SharedSessionContractImplementor session)
Should the parent be considered dirty, given both the old and current value?boolean
isEntityType()
Return true if the implementation is castable toEntityType
.boolean
isEqual(java.lang.Object x, java.lang.Object y)
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state).boolean
isEqual(java.lang.Object x, java.lang.Object y, SessionFactoryImplementor factory)
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state).boolean
isModified(java.lang.Object dbState, java.lang.Object currentState, boolean[] checkable, SharedSessionContractImplementor session)
Has the value been modified compared to the current database state? The difference between this and theisDirty(java.lang.Object, java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor)
methods is that here we need to account for "partially" built values.boolean
isMutable()
Are objects of this type mutable.boolean
isSame(java.lang.Object x, java.lang.Object y)
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state) taking a shortcut for entity references.java.lang.Object
nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, SharedSessionContractImplementor session, java.lang.Object owner)
Extract a value of themapped class
from the JDBC result set.java.lang.Object
nullSafeGet(java.sql.ResultSet rs, java.lang.String name, SharedSessionContractImplementor session, java.lang.Object owner)
Extract a value of themapped class
from the JDBC result set.void
nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, boolean[] settable, SharedSessionContractImplementor session)
Bind a value represented by an instance of themapped class
to the JDBC prepared statement, ignoring some columns as dictated by the 'settable' parameter.void
nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, SharedSessionContractImplementor session)
Bind a value represented by an instance of themapped class
to the JDBC prepared statement.java.lang.Object
replace(java.lang.Object original, java.lang.Object target, SharedSessionContractImplementor session, java.lang.Object owner, java.util.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.java.lang.Object
replace(java.lang.Object original, java.lang.Object target, SharedSessionContractImplementor session, java.lang.Object owner, java.util.Map copyCache, ForeignKeyDirection foreignKeyDirection)
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.java.lang.Object
resolve(java.lang.Object value, SharedSessionContractImplementor session, java.lang.Object owner)
default java.lang.Object
resolve(java.lang.Object value, SharedSessionContractImplementor session, java.lang.Object owner, java.lang.Boolean overridingEager)
The second phase of 2-phase loading.java.lang.Object
semiResolve(java.lang.Object value, SharedSessionContractImplementor session, java.lang.Object owner)
Given a hydrated, but unresolved value, return a value that may be used to reconstruct property-ref associations.int[]
sqlTypes(Mapping mapping)
Return the JDBC types codes (perTypes
) for the columns mapped by this type.boolean[]
toColumnNullness(java.lang.Object value, Mapping mapping)
Given an instance of the type, return an array of boolean, indicating which mapped columns would be null.java.lang.String
toLoggableString(java.lang.Object value, SessionFactoryImplementor factory)
Generate a representation of the value for logging purposes.
-
-
-
Method Detail
-
isAssociationType
boolean isAssociationType()
Return true if the implementation is castable toAssociationType
. This does not necessarily imply that the type actually represents an association. Essentially a polymorphic version of(type instanceof AssociationType.class)
- Returns:
- True if this type is also an
AssociationType
implementor; false otherwise.
-
isCollectionType
boolean isCollectionType()
Return true if the implementation is castable toCollectionType
. Essentially a polymorphic version of(type instanceof CollectionType.class)
ACollectionType
is additionally anAssociationType
; so if this method returns true,isAssociationType()
should also return true.- Returns:
- True if this type is also a
CollectionType
implementor; false otherwise.
-
isEntityType
boolean isEntityType()
Return true if the implementation is castable toEntityType
. Essentially a polymorphic version of(type instanceof EntityType.class)
. AnEntityType
is additionally anAssociationType
; so if this method returns true,isAssociationType()
should also return true.- Returns:
- True if this type is also an
EntityType
implementor; false otherwise.
-
isAnyType
boolean isAnyType()
Return true if the implementation is castable toAnyType
. Essentially a polymorphic version of(type instanceof AnyType.class)
. AnAnyType
is additionally anAssociationType
; so if this method returns true,isAssociationType()
should also return true.- Returns:
- True if this type is also an
AnyType
implementor; false otherwise.
-
isComponentType
boolean isComponentType()
Return true if the implementation is castable toCompositeType
. Essentially a polymorphic version of(type instanceof CompositeType.class)
. A component type may own collections or associations and hence must provide certain extra functionality.- Returns:
- True if this type is also a
CompositeType
implementor; false otherwise.
-
getColumnSpan
int getColumnSpan(Mapping mapping) throws MappingException
How many columns are used to persist this type. Always the same assqlTypes(mapping).length
- Parameters:
mapping
- The mapping object :/- Returns:
- The number of columns
- Throws:
MappingException
- Generally indicates an issue accessing the passed mapping object.
-
sqlTypes
int[] sqlTypes(Mapping mapping) throws MappingException
Return the JDBC types codes (perTypes
) for the columns mapped by this type. NOTE: The number of elements in this array matches the return fromgetColumnSpan(org.hibernate.engine.spi.Mapping)
.- Parameters:
mapping
- The mapping object :/- Returns:
- The JDBC type codes.
- Throws:
MappingException
- Generally indicates an issue accessing the passed mapping object.
-
dictatedSizes
Size[] dictatedSizes(Mapping mapping) throws MappingException
Return the column sizes dictated by this type. For example, the mapping for achar
/Character
would have a dictated length limit of 1; for a string-basedUUID
would have a size limit of 36; etc. NOTE: The number of elements in this array matches the return fromgetColumnSpan(org.hibernate.engine.spi.Mapping)
.- Parameters:
mapping
- The mapping object :/- Returns:
- The dictated sizes.
- Throws:
MappingException
- Generally indicates an issue accessing the passed mapping object.
-
defaultSizes
Size[] defaultSizes(Mapping mapping) throws MappingException
Defines the column sizes to use according to this type if the user did not explicitly say (and if nodictatedSizes(org.hibernate.engine.spi.Mapping)
were given). NOTE: The number of elements in this array matches the return fromgetColumnSpan(org.hibernate.engine.spi.Mapping)
.- Parameters:
mapping
- The mapping object :/- Returns:
- The default sizes.
- Throws:
MappingException
- Generally indicates an issue accessing the passed mapping object.
-
getReturnedClass
java.lang.Class getReturnedClass()
The class returned bynullSafeGet(java.sql.ResultSet, java.lang.String[], org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
methods. This is used to establish the class of an array of this type.- Returns:
- The java type class handled by this type.
-
isSame
boolean isSame(java.lang.Object x, java.lang.Object y) throws HibernateException
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state) taking a shortcut for entity references. For most types this should equate to anequals
check on the values. For associations the implication is a bit different. For most types it is conceivable to simply delegate toisEqual(java.lang.Object, java.lang.Object)
- Parameters:
x
- The first valuey
- The second value- Returns:
- True if there are considered the same (see discussion above).
- Throws:
HibernateException
- A problem occurred performing the comparison
-
isEqual
boolean isEqual(java.lang.Object x, java.lang.Object y) throws HibernateException
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state). This should always equate to some form of comparison of the value's internal state. As an example, for something like a date the comparison should be based on its internal "time" state based on the specific portion it is meant to represent (timestamp, date, time).- Parameters:
x
- The first valuey
- The second value- Returns:
- True if there are considered equal (see discussion above).
- Throws:
HibernateException
- A problem occurred performing the comparison
-
isEqual
boolean isEqual(java.lang.Object x, java.lang.Object y, SessionFactoryImplementor factory) throws HibernateException
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state). This should always equate to some form of comparison of the value's internal state. As an example, for something like a date the comparison should be based on its internal "time" state based on the specific portion it is meant to represent (timestamp, date, time).- Parameters:
x
- The first valuey
- The second valuefactory
- The session factory- Returns:
- True if there are considered equal (see discussion above).
- Throws:
HibernateException
- A problem occurred performing the comparison
-
getHashCode
int getHashCode(java.lang.Object x) throws HibernateException
Get a hash code, consistent with persistence "equality". Again for most types the normal usage is to delegate to the value'shashCode
.- Parameters:
x
- The value for which to retrieve a hash code- Returns:
- The hash code
- Throws:
HibernateException
- A problem occurred calculating the hash code
-
getHashCode
int getHashCode(java.lang.Object x, SessionFactoryImplementor factory) throws HibernateException
Get a hash code, consistent with persistence "equality". Again for most types the normal usage is to delegate to the value'shashCode
.- Parameters:
x
- The value for which to retrieve a hash codefactory
- The session factory- Returns:
- The hash code
- Throws:
HibernateException
- A problem occurred calculating the hash code
-
compare
int compare(java.lang.Object x, java.lang.Object y)
Perform aComparator
style comparison between values- Parameters:
x
- The first valuey
- The second value- Returns:
- The comparison result. See
Comparator.compare(T, T)
for a discussion.
-
isDirty
boolean isDirty(java.lang.Object old, java.lang.Object current, SharedSessionContractImplementor session) throws HibernateException
Should the parent be considered dirty, given both the old and current value?- Parameters:
old
- the old valuecurrent
- the current valuesession
- The session from which the request originated.- Returns:
- true if the field is dirty
- Throws:
HibernateException
- A problem occurred performing the checking
-
isDirty
boolean isDirty(java.lang.Object oldState, java.lang.Object currentState, boolean[] checkable, SharedSessionContractImplementor session) throws HibernateException
Should the parent be considered dirty, given both the old and current value?- Parameters:
oldState
- the old valuecurrentState
- the current valuecheckable
- An array of booleans indicating which columns making up the value are actually checkablesession
- The session from which the request originated.- Returns:
- true if the field is dirty
- Throws:
HibernateException
- A problem occurred performing the checking
-
isModified
boolean isModified(java.lang.Object dbState, java.lang.Object currentState, boolean[] checkable, SharedSessionContractImplementor session) throws HibernateException
Has the value been modified compared to the current database state? The difference between this and theisDirty(java.lang.Object, java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor)
methods is that here we need to account for "partially" built values. This is really only an issue with association types. For most type implementations it is enough to simply delegate toisDirty(java.lang.Object, java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor)
here/- Parameters:
dbState
- the database state, in a "hydrated" form, with identifiers unresolvedcurrentState
- the current state of the objectcheckable
- which columns are actually updatablesession
- The session from which the request originated.- Returns:
- true if the field has been modified
- Throws:
HibernateException
- A problem occurred performing the checking
-
nullSafeGet
java.lang.Object nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, SharedSessionContractImplementor session, java.lang.Object owner) throws HibernateException, java.sql.SQLException
Extract a value of themapped class
from the JDBC result set. Implementors should handle possibility of null values.- Parameters:
rs
- The result set from which to extract value.names
- the column names making up this type value (use to read from result set)session
- The originating sessionowner
- the parent entity- Returns:
- The extracted value
- Throws:
HibernateException
- An error from Hibernatejava.sql.SQLException
- An error from the JDBC driver- See Also:
alternative, 2-phase property initialization
-
nullSafeGet
java.lang.Object nullSafeGet(java.sql.ResultSet rs, java.lang.String name, SharedSessionContractImplementor session, java.lang.Object owner) throws HibernateException, java.sql.SQLException
Extract a value of themapped class
from the JDBC result set. Implementors should handle possibility of null values. This form might be called if the type is known to be a single-column type.- Parameters:
rs
- The result set from which to extract value.name
- the column name making up this type value (use to read from result set)session
- The originating sessionowner
- the parent entity- Returns:
- The extracted value
- Throws:
HibernateException
- An error from Hibernatejava.sql.SQLException
- An error from the JDBC driver
-
nullSafeSet
void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, boolean[] settable, SharedSessionContractImplementor session) throws HibernateException, java.sql.SQLException
Bind a value represented by an instance of themapped class
to the JDBC prepared statement, ignoring some columns as dictated by the 'settable' parameter. Implementors should handle the possibility of null values. A multi-column type should bind parameters starting from index.- Parameters:
st
- The JDBC prepared statement to which to bindvalue
- the object to writeindex
- starting parameter bind indexsettable
- an array indicating which columns to bind/ignoresession
- The originating session- Throws:
HibernateException
- An error from Hibernatejava.sql.SQLException
- An error from the JDBC driver
-
nullSafeSet
void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, SharedSessionContractImplementor session) throws HibernateException, java.sql.SQLException
Bind a value represented by an instance of themapped class
to the JDBC prepared statement. Implementors should handle possibility of null values. A multi-column type should bind parameters starting from index.- Parameters:
st
- The JDBC prepared statement to which to bindvalue
- the object to writeindex
- starting parameter bind indexsession
- The originating session- Throws:
HibernateException
- An error from Hibernatejava.sql.SQLException
- An error from the JDBC driver
-
toLoggableString
java.lang.String toLoggableString(java.lang.Object value, SessionFactoryImplementor factory) throws HibernateException
Generate a representation of the value for logging purposes.- Parameters:
value
- The value to be loggedfactory
- The session factory- Returns:
- The loggable representation
- Throws:
HibernateException
- An error from Hibernate
-
getName
java.lang.String getName()
Returns the abbreviated name of the type.- Returns:
- String the Hibernate type name
-
deepCopy
java.lang.Object deepCopy(java.lang.Object value, SessionFactoryImplementor factory) throws HibernateException
Return a deep copy of the persistent state, stopping at entities and at collections.- Parameters:
value
- The value to be copiedfactory
- The session factory- Returns:
- The deep copy
- Throws:
HibernateException
- An error from Hibernate
-
isMutable
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.)- Returns:
- boolean
-
disassemble
java.io.Serializable disassemble(java.lang.Object value, SharedSessionContractImplementor session, java.lang.Object owner) throws HibernateException
Return a disassembled representation of the object. This is the value Hibernate will use in second level caching, so care should be taken to break values down to their simplest forms; for entities especially, this means breaking them down into their constituent parts.- Parameters:
value
- the value to cachesession
- the originating sessionowner
- optional parent entity object (needed for collections)- Returns:
- the disassembled, deep cloned state
- Throws:
HibernateException
- An error from Hibernate
-
assemble
java.lang.Object assemble(java.io.Serializable cached, SharedSessionContractImplementor session, java.lang.Object owner) throws HibernateException
Reconstruct the object from its disassembled state. This method is the reciprocal ofdisassemble(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
- Parameters:
cached
- the disassembled state from the cachesession
- the originating sessionowner
- the parent entity object- Returns:
- the (re)assembled object
- Throws:
HibernateException
- An error from Hibernate
-
beforeAssemble
void beforeAssemble(java.io.Serializable cached, SharedSessionContractImplementor session)
Called before assembling a query result set from the query cache, to allow batch fetching of entities missing from the second-level cache.- Parameters:
cached
- The keysession
- The originating session
-
hydrate
java.lang.Object hydrate(java.sql.ResultSet rs, java.lang.String[] names, SharedSessionContractImplementor session, java.lang.Object owner) throws HibernateException, java.sql.SQLException
Extract a value from the JDBC result set. This is useful for 2-phase property initialization - the second phase is a call toresolve(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
This hydrated value will be either:- in the case of an entity or collection type, the key
- otherwise, the value itself
- Parameters:
rs
- The JDBC result setnames
- the column names making up this type value (use to read from result set)session
- The originating sessionowner
- the parent entity- Returns:
- An entity or collection key, or an actual value.
- Throws:
HibernateException
- An error from Hibernatejava.sql.SQLException
- An error from the JDBC driver- See Also:
resolve(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
-
resolve
java.lang.Object resolve(java.lang.Object value, SharedSessionContractImplementor session, java.lang.Object owner) throws HibernateException
-
resolve
default java.lang.Object resolve(java.lang.Object value, SharedSessionContractImplementor session, java.lang.Object owner, java.lang.Boolean overridingEager) throws HibernateException
The second phase of 2-phase loading. Only really pertinent for entities and collections. Here we resolve the identifier to an entity or collection instance- Parameters:
value
- an identifier or value returned by hydrate()owner
- the parent entitysession
- the sessionoverridingEager
- can override eager from the mapping. For example because ofLoadQueryInfluencers
If null, then it does not override. If true or false then it overrides the mapping value.- Returns:
- the given value, or the value associated with the identifier
- Throws:
HibernateException
- An error from Hibernate- See Also:
hydrate(java.sql.ResultSet, java.lang.String[], org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
-
semiResolve
java.lang.Object semiResolve(java.lang.Object value, SharedSessionContractImplementor session, java.lang.Object owner) throws HibernateException
Given a hydrated, but unresolved value, return a value that may be used to reconstruct property-ref associations.- Parameters:
value
- The unresolved, hydrated valuesession
- THe originating sessionowner
- The value owner- Returns:
- The semi-resolved value
- Throws:
HibernateException
- An error from Hibernate
-
getSemiResolvedType
Type getSemiResolvedType(SessionFactoryImplementor factory)
As part of 2-phase loading, when we perform resolving what is the resolved type for this type? Generally speaking the type and its semi-resolved type will be the same. The main deviation from this is in the case of an entity where the type would be the entity type and semi-resolved type would be its identifier type- Parameters:
factory
- The session factory- Returns:
- The semi-resolved type
-
replace
java.lang.Object replace(java.lang.Object original, java.lang.Object target, SharedSessionContractImplementor session, java.lang.Object owner, java.util.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.- Parameters:
original
- the value from the detached entity being mergedtarget
- the value in the managed entitysession
- The originating sessionowner
- The owner of the valuecopyCache
- The cache of already copied/replaced values- Returns:
- the value to be merged
- Throws:
HibernateException
- An error from Hibernate
-
replace
java.lang.Object replace(java.lang.Object original, java.lang.Object target, SharedSessionContractImplementor session, java.lang.Object owner, java.util.Map copyCache, ForeignKeyDirection foreignKeyDirection) 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.- Parameters:
original
- the value from the detached entity being mergedtarget
- the value in the managed entitysession
- The originating sessionowner
- The owner of the valuecopyCache
- The cache of already copied/replaced valuesforeignKeyDirection
- For associations, which direction does the foreign key point?- Returns:
- the value to be merged
- Throws:
HibernateException
- An error from Hibernate
-
toColumnNullness
boolean[] toColumnNullness(java.lang.Object value, Mapping mapping)
Given an instance of the type, return an array of boolean, indicating which mapped columns would be null.- Parameters:
value
- an instance of the typemapping
- The mapping abstraction- Returns:
- array indicating column nullness for a value instance
-
-