C# Class Castle.ActiveRecord.HookDispatcher

Translates the IInterceptor messages to instance possible hooks
Inheritance: NHibernate.EmptyInterceptor
Afficher le fichier Open project: shosca/ActiveRecord

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
HookDispatcher ( ) : System.Collections

Initializes a new instance of the HookDispatcher class.

Method Details

FindDirty() public méthode

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
Résultat int[]

HookDispatcher() protected méthode

Initializes a new instance of the HookDispatcher class.
protected HookDispatcher ( ) : System.Collections
Résultat System.Collections

Instantiate() public méthode

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
Résultat object

IsTransient() public méthode

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
Résultat bool?

OnDelete() public méthode

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
Résultat void

OnFlushDirty() public méthode

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
Résultat bool

OnLoad() public méthode

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
Résultat bool

OnSave() public méthode

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
Résultat bool

PostFlush() public méthode

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
Résultat void

PreFlush() public méthode

Called before a flush
public PreFlush ( ICollection entities ) : void
entities ICollection The entities
Résultat void