Namespaces

Types

Type ICompositeUserType

Namespace NHibernate.UserTypes

Methods

Properties

Public instance methods

object Assemble(object cached, ISessionImplementor session, object owner)

Reconstruct an object from the cacheable representation. At the very least this method should perform a deep copy. (optional operation)
Parameters
return object
object cached the object to be cached
ISessionImplementor session
object owner

object DeepCopy(object value)

Return a deep copy of the persistent state, stopping at entities and at collections.
Parameters
return object
object value generally a collection element or entity field

object Disassemble(object value, ISessionImplementor session)

Transform the object into its cacheable representation. At the very least this method should perform a deep copy. That may not be enough for some implementations, method should perform a deep copy. That may not be enough for some implementations, however; for example, associations must be cached as identifier values. (optional operation)
Parameters
return object
object value the object to be cached
ISessionImplementor session

bool Equals(object x, object y)

Compare two instances of the class mapped by this type for persistence "equality", ie. equality of persistent state.
Parameters
return bool
object x
object y

int GetHashCode(object x)

Get a hashcode for the instance, consistent with persistence "equality"
Parameters
return int
object x

object GetPropertyValue(object component, int property)

Get the value of a property
Parameters
return object the property value
object component an instance of class mapped by this "type"
int property

object NullSafeGet(IDataReader dr, String[] names, ISessionImplementor session, object owner)

Parameters
return object
IDataReader dr
String[] names
ISessionImplementor session
object owner

void NullSafeSet(IDbCommand cmd, object value, int index, ISessionImplementor session)

Write an instance of the mapped class to a prepared statement. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.
Parameters
IDbCommand cmd
object value
int index
ISessionImplementor session

object Replace(object original, object target, ISessionImplementor session, object owner)

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. However, since composite user types often define component values, it might make sense to recursively replace component values in the target object.
Parameters
return object
object original
object target
ISessionImplementor session
object owner

void SetPropertyValue(object component, int property, object value)

Set the value of a property
Parameters
object component an instance of class mapped by this "type"
int property
object value the value to set

Public properties

bool IsMutable get;

Are objects of this type mutable?
return bool

String[] PropertyNames get;

Get the "property names" that may be used in a query.
return String[]

IType[] PropertyTypes get;

Get the corresponding "property types"
return IType[]

Type ReturnedClass get;

The class returned by NullSafeGet().
return Type