Called before an object is saved

Namespace:  NHibernate
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
Function OnSave ( _
	entity As Object, _
	id As Object, _
	state As Object(), _
	propertyNames As String(), _
	types As IType() _
) As Boolean
C#
bool OnSave(
	Object entity,
	Object id,
	Object[] state,
	string[] propertyNames,
	IType[] types
)
Visual C++
bool OnSave(
	Object^ entity, 
	Object^ id, 
	array<Object^>^ state, 
	array<String^>^ propertyNames, 
	array<IType^>^ types
)
JavaScript
function onSave(entity, id, state, propertyNames, types);

Parameters

entity
Type: System..::.Object
id
Type: System..::.Object
state
Type: array< System..::.Object >[]()[]
propertyNames
Type: array< System..::.String >[]()[]
types
Type: array< NHibernate.Type..::.IType >[]()[]

Return Value

trueTruetruetrue (True in Visual Basic) if the user modified the state in any way

Remarks

The interceptor may modify the state, which will be used for the SQL INSERT and propagated to the persistent object

See Also