Namespaces

Types

Type IUserType

Namespace NHibernate.UserTypes

Methods

Properties

Public instance methods

object Assemble(object cached, object owner)

Reconstruct an object from the cacheable representation. At the very least this method should perform a deep copy if the type is mutable. (optional operation)
Parameters
return object a reconstructed object from the cachable representation
object cached the object to be cached
object owner the owner of the cached object

object DeepCopy(object value)

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

object Disassemble(object value)

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

bool Equals(object x, object y)

Compare two instances of the class mapped by this type for persistent "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 NullSafeGet(IDataReader rs, String[] names, object owner)

Parameters
return object
IDataReader rs
String[] names
object owner

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

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 a IDbCommand
object value the object to write
int index command parameter index

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

During merge, replace the existing ( ) value in the entity we are merging to with a new ( ) 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
return object the value to be merged
object original the value from the detached entity being merged
object target the value in the managed entity
object owner the managed entity

Public properties

bool IsMutable get;

Are objects of this type mutable?
return bool

Type ReturnedType get;

The type returned by NullSafeGet()
return Type

SqlType[] SqlTypes get;

The SQL types for the columns mapped by this type.
return SqlType[]