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.

Namespace: NHibernate.UserTypes
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
Object Replace(
	Object original,
	Object target,
	ISessionImplementor session,
	Object owner
)
Visual Basic
Function Replace ( _
	original As Object, _
	target As Object, _
	session As ISessionImplementor, _
	owner As Object _
) As Object
Visual C++
Object^ Replace(
	Object^ original, 
	Object^ target, 
	ISessionImplementor^ session, 
	Object^ owner
)

Parameters

original
Type: System..::..Object

[Missing <param name="original"/> documentation for "M:NHibernate.UserTypes.ICompositeUserType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object)"]

target
Type: System..::..Object

[Missing <param name="target"/> documentation for "M:NHibernate.UserTypes.ICompositeUserType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object)"]

session
Type: NHibernate.Engine..::..ISessionImplementor

[Missing <param name="session"/> documentation for "M:NHibernate.UserTypes.ICompositeUserType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object)"]

owner
Type: System..::..Object

[Missing <param name="owner"/> documentation for "M:NHibernate.UserTypes.ICompositeUserType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object)"]

Return Value

[Missing <returns> documentation for "M:NHibernate.UserTypes.ICompositeUserType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object)"]

See Also