C# Класс Castle.ActiveRecord.HookDispatcher

Translates the IInterceptor messages to instance possible hooks
Наследование: NHibernate.EmptyInterceptor
Показать файл Открыть проект

Открытые методы

Метод Описание
FindDirty ( object entity, object id, object currentState, object previousState, string propertyNames, IType types ) : int[]

Called from Flush(). The return value determines whether the entity is updated

an array of property indicies - the entity is dirty an empty array - the entity is not dirty null - use Hibernate's default dirty-checking algorithm

Instantiate ( System entityName, EntityMode entityMode, object id ) : object

Instantiate the entity class. Return to indicate that Hibernate should use the default constructor of the class

The identifier property of the returned instance should be initialized with the given identifier.

IsTransient ( object entity ) : bool?

Called when a transient entity is passed to SaveOrUpdate.

The return value determines if the object is saved - the entity is passed to Save(), resulting in an INSERT - the entity is passed to Update(), resulting in an UPDATE - Hibernate uses the unsaved-value mapping to determine if the object is unsaved

OnDelete ( object entity, object id, object state, string propertyNames, IType types ) : void

Called before an object is deleted

It is not recommended that the interceptor modify the state.

OnFlushDirty ( object entity, object id, object currentState, object previousState, string propertyNames, IType types ) : bool

Called when an object is detected to be dirty, during a flush.

The interceptor may modify the detected currentState, which will be propagated to both the database and the persistent object. Note that all flushes end in an actual synchronization with the database, in which as the new currentState will be propagated to the object, but not necessarily (immediately) to the database. It is strongly recommended that the interceptor not modify the previousState.

OnLoad ( object entity, object id, object state, string propertyNames, IType types ) : bool

Called just before an object is initialized

The interceptor may change the state, which will be propagated to the persistent object. Note that when this method is called, entity will be an empty uninitialized instance of the class.

OnSave ( object entity, object id, object state, string propertyNames, IType types ) : bool

Called before an object is saved

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

PostFlush ( ICollection entities ) : void

Called after a flush that actually ends in execution of the SQL statements required to synchronize in-memory state with the database.

PreFlush ( ICollection entities ) : void

Called before a flush

Защищенные методы

Метод Описание
HookDispatcher ( ) : System.Collections

Initializes a new instance of the HookDispatcher class.

Описание методов

FindDirty() публичный Метод

Called from Flush(). The return value determines whether the entity is updated
an array of property indicies - the entity is dirty an empty array - the entity is not dirty null - use Hibernate's default dirty-checking algorithm
public FindDirty ( object entity, object id, object currentState, object previousState, string propertyNames, IType types ) : int[]
entity object A persistent entity
id object
currentState object
previousState object
propertyNames string
types IType
Результат int[]

HookDispatcher() защищенный Метод

Initializes a new instance of the HookDispatcher class.
protected HookDispatcher ( ) : System.Collections
Результат System.Collections

Instantiate() публичный Метод

Instantiate the entity class. Return to indicate that Hibernate should use the default constructor of the class
The identifier property of the returned instance should be initialized with the given identifier.
public Instantiate ( System entityName, EntityMode entityMode, object id ) : object
entityName System the name of the entity
entityMode EntityMode The type of entity instance to be returned.
id object the identifier of the new instance
Результат object

IsTransient() публичный Метод

Called when a transient entity is passed to SaveOrUpdate.
The return value determines if the object is saved - the entity is passed to Save(), resulting in an INSERT - the entity is passed to Update(), resulting in an UPDATE - Hibernate uses the unsaved-value mapping to determine if the object is unsaved
public IsTransient ( object entity ) : bool?
entity object A transient entity
Результат bool?

OnDelete() публичный Метод

Called before an object is deleted
It is not recommended that the interceptor modify the state.
public OnDelete ( object entity, object id, object state, string propertyNames, IType types ) : void
entity object
id object
state object
propertyNames string
types IType
Результат void

OnFlushDirty() публичный Метод

Called when an object is detected to be dirty, during a flush.
The interceptor may modify the detected currentState, which will be propagated to both the database and the persistent object. Note that all flushes end in an actual synchronization with the database, in which as the new currentState will be propagated to the object, but not necessarily (immediately) to the database. It is strongly recommended that the interceptor not modify the previousState.
public OnFlushDirty ( object entity, object id, object currentState, object previousState, string propertyNames, IType types ) : bool
entity object
id object
currentState object
previousState object
propertyNames string
types IType
Результат bool

OnLoad() публичный Метод

Called just before an object is initialized
The interceptor may change the state, which will be propagated to the persistent object. Note that when this method is called, entity will be an empty uninitialized instance of the class.
public OnLoad ( object entity, object id, object state, string propertyNames, IType types ) : bool
entity object
id object
state object
propertyNames string
types IType
Результат bool

OnSave() публичный Метод

Called before an object is saved
The interceptor may modify the state, which will be used for the SQL INSERT and propagated to the persistent object
public OnSave ( object entity, object id, object state, string propertyNames, IType types ) : bool
entity object
id object
state object
propertyNames string
types IType
Результат bool

PostFlush() публичный Метод

Called after a flush that actually ends in execution of the SQL statements required to synchronize in-memory state with the database.
public PostFlush ( ICollection entities ) : void
entities ICollection The entitites
Результат void

PreFlush() публичный Метод

Called before a flush
public PreFlush ( ICollection entities ) : void
entities ICollection The entities
Результат void