public class

TypeHelper

extends Object
java.lang.Object
   ↳ org.hibernate.type.TypeHelper

Class Overview

Collection of convenience methods relating to operations across arrays of types...

Summary

Public Methods
static Object[] assemble(Serializable[] row, Type[] types, SessionImplementor session, Object owner)
Apply the assemble(Serializable, SessionImplementor, Object) operation across a series of values.
static void beforeAssemble(Serializable[] row, Type[] types, SessionImplementor session)
Apply the beforeAssemble(Serializable, SessionImplementor) operation across a series of values.
static void deepCopy(Object[] values, Type[] types, boolean[] copy, Object[] target, SessionImplementor session)
Deep copy a series of values from one array to another...
static Serializable[] disassemble(Object[] row, Type[] types, boolean[] nonCacheable, SessionImplementor session, Object owner)
Apply the disassemble(Object, SessionImplementor, Object) operation across a series of values.
static int[] findDirty(StandardProperty[] properties, Object[] currentState, Object[] previousState, boolean[][] includeColumns, boolean anyUninitializedProperties, SessionImplementor session)
Determine if any of the given field values are dirty, returning an array containing indices of the dirty fields.
static int[] findModified(StandardProperty[] properties, Object[] currentState, Object[] previousState, boolean[][] includeColumns, boolean anyUninitializedProperties, SessionImplementor session)
Determine if any of the given field values are modified, returning an array containing indices of the modified fields.
static Object[] replace(Object[] original, Object[] target, Type[] types, SessionImplementor session, Object owner, Map copyCache)
Apply the replace(Object, Object, SessionImplementor, Object, Map) operation across a series of values.
static Object[] replace(Object[] original, Object[] target, Type[] types, SessionImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection)
Apply the replace(Object, Object, SessionImplementor, Object, Map) operation across a series of values.
static Object[] replaceAssociations(Object[] original, Object[] target, Type[] types, SessionImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection)
Apply the replace(Object, Object, SessionImplementor, Object, Map) operation across a series of values, as long as the corresponding Type is an association.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Object[] assemble (Serializable[] row, Type[] types, SessionImplementor session, Object owner)

Apply the assemble(Serializable, SessionImplementor, Object) operation across a series of values.

Parameters
row The values
types The value types
session The originating session
owner The entity "owning" the values
Returns
  • The assembled state

public static void beforeAssemble (Serializable[] row, Type[] types, SessionImplementor session)

Apply the beforeAssemble(Serializable, SessionImplementor) operation across a series of values.

Parameters
row The values
types The value types
session The originating session

public static void deepCopy (Object[] values, Type[] types, boolean[] copy, Object[] target, SessionImplementor session)

Deep copy a series of values from one array to another...

Parameters
values The values to copy (the source)
types The value types
copy an array indicating which values to include in the copy
target The array into which to copy the values
session The originating session

public static Serializable[] disassemble (Object[] row, Type[] types, boolean[] nonCacheable, SessionImplementor session, Object owner)

Apply the disassemble(Object, SessionImplementor, Object) operation across a series of values.

Parameters
row The values
types The value types
nonCacheable An array indicating which values to include in the disassembled state
session The originating session
owner The entity "owning" the values
Returns
  • The disassembled state

public static int[] findDirty (StandardProperty[] properties, Object[] currentState, Object[] previousState, boolean[][] includeColumns, boolean anyUninitializedProperties, SessionImplementor session)

Determine if any of the given field values are dirty, returning an array containing indices of the dirty fields.

If it is determined that no fields are dirty, null is returned.

Parameters
properties The property definitions
currentState The current state of the entity
previousState The baseline state of the entity
includeColumns Columns to be included in the dirty checking, per property
anyUninitializedProperties Does the entity currently hold any uninitialized property values?
session The session from which the dirty check request originated.
Returns
  • Array containing indices of the dirty properties, or null if no properties considered dirty.

public static int[] findModified (StandardProperty[] properties, Object[] currentState, Object[] previousState, boolean[][] includeColumns, boolean anyUninitializedProperties, SessionImplementor session)

Determine if any of the given field values are modified, returning an array containing indices of the modified fields.

If it is determined that no fields are dirty, null is returned.

Parameters
properties The property definitions
currentState The current state of the entity
previousState The baseline state of the entity
includeColumns Columns to be included in the mod checking, per property
anyUninitializedProperties Does the entity currently hold any uninitialized property values?
session The session from which the dirty check request originated.
Returns
  • Array containing indices of the modified properties, or null if no properties considered modified.

public static Object[] replace (Object[] original, Object[] target, Type[] types, SessionImplementor session, Object owner, Map copyCache)

Apply the replace(Object, Object, SessionImplementor, Object, Map) operation across a series of values.

Parameters
original The source of the state
target The target into which to replace the source values.
types The value types
session The originating session
owner The entity "owning" the values
copyCache A map representing a cache of already replaced state
Returns
  • The replaced state

public static Object[] replace (Object[] original, Object[] target, Type[] types, SessionImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection)

Apply the replace(Object, Object, SessionImplementor, Object, Map) operation across a series of values.

Parameters
original The source of the state
target The target into which to replace the source values.
types The value types
session The originating session
owner The entity "owning" the values
copyCache A map representing a cache of already replaced state
foreignKeyDirection FK directionality to be applied to the replacement
Returns
  • The replaced state

public static Object[] replaceAssociations (Object[] original, Object[] target, Type[] types, SessionImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection)

Apply the replace(Object, Object, SessionImplementor, Object, Map) operation across a series of values, as long as the corresponding Type is an association.

If the corresponding type is a component type, then apply replace(Object, Object, SessionImplementor, Object, Map) across the component subtypes but do not replace the component value itself.

Parameters
original The source of the state
target The target into which to replace the source values.
types The value types
session The originating session
owner The entity "owning" the values
copyCache A map representing a cache of already replaced state
foreignKeyDirection FK directionality to be applied to the replacement
Returns
  • The replaced state