Package org.hibernate.type
Class TypeHelper
- java.lang.Object
-
- org.hibernate.type.TypeHelper
-
public class TypeHelper extends Object
Certain operations for working with arrays of property values.
-
-
Method Summary
-
-
-
Method Detail
-
deepCopy
public static void deepCopy(Object[] values, Type[] types, boolean[] copy, Object[] target, SharedSessionContractImplementor session)
Deep copy a series of values from one array to another...- Parameters:
values- The values to copy (the source)types- The value typescopy- an array indicating which values to include in the copytarget- The array into which to copy the valuessession- The originating session
-
replace
public static Object[] replace(Object[] original, Object[] target, Type[] types, SharedSessionContractImplementor session, Object owner, Map<Object,Object> copyCache)
Apply theType.replace(java.lang.Object, java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.util.Map<java.lang.Object, java.lang.Object>)operation across a series of values.- Parameters:
original- The source of the statetarget- The target into which to replace the source values.types- The value typessession- The originating sessionowner- The entity "owning" the valuescopyCache- A map representing a cache of already replaced state- Returns:
- The replaced state
-
replace
public static void replace(EntityPersister persister, Object entity, SharedSessionContractImplementor session, Object owner, Map<Object,Object> copyCache)
Apply theType.replace(java.lang.Object, java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.util.Map<java.lang.Object, java.lang.Object>)operation across a series of values.- Parameters:
persister- The EntityPersisterentity- The source of the statesession- The originating sessionowner- The entity "owning" the valuescopyCache- A map representing a cache of already replaced state
-
replace
public static Object[] replace(Object[] original, Object[] target, Type[] types, SharedSessionContractImplementor session, Object owner, Map<Object,Object> copyCache, ForeignKeyDirection foreignKeyDirection)
Apply theType.replace(java.lang.Object, java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.util.Map<java.lang.Object, java.lang.Object>)operation across a series of values.- Parameters:
original- The source of the statetarget- The target into which to replace the source values.types- The value typessession- The originating sessionowner- The entity "owning" the valuescopyCache- A map representing a cache of already replaced stateforeignKeyDirection- FK directionality to be applied to the replacement- Returns:
- The replaced state
-
replaceAssociations
public static Object[] replaceAssociations(Object[] original, Object[] target, Type[] types, SharedSessionContractImplementor session, Object owner, Map<Object,Object> copyCache, ForeignKeyDirection foreignKeyDirection)
Apply theType.replace(java.lang.Object, java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.util.Map<java.lang.Object, java.lang.Object>)operation across a series of values, as long as the correspondingTypeis an association. If the corresponding type is a component type, then applyType.replace(java.lang.Object, java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.util.Map<java.lang.Object, java.lang.Object>)across the component subtypes but do not replace the component value itself.- Parameters:
original- The source of the statetarget- The target into which to replace the source values.types- The value typessession- The originating sessionowner- The entity "owning" the valuescopyCache- A map representing a cache of already replaced stateforeignKeyDirection- FK directionality to be applied to the replacement- Returns:
- The replaced state
-
-