org.hibernate.engine
Class Cascade

java.lang.Object
  extended by org.hibernate.engine.Cascade

public final class Cascade
extends Object

Delegate responsible for, in conjunction with the various actions, implementing cascade processing.

Author:
Gavin King
See Also:
CascadingAction

Field Summary
static int AFTER_EVICT
          A cascade point that occurs just after eviction of the parent entity from the session cache
static int AFTER_INSERT_BEFORE_DELETE
          A cascade point that occurs just after the insertion of the parent entity and just before deletion
static int AFTER_INSERT_BEFORE_DELETE_VIA_COLLECTION
          A cascade point that occurs just after the insertion of the parent entity and just before deletion, inside a collection
static int AFTER_LOCK
          A cascade point that occurs just after refreshing a parent entity
static int AFTER_UPDATE
          A cascade point that occurs just after update of the parent entity
static int BEFORE_FLUSH
          A cascade point that occurs just before the session is flushed
static int BEFORE_INSERT_AFTER_DELETE
          A cascade point that occurs just before the insertion of the parent entity and just after deletion
static int BEFORE_MERGE
          A cascade point that occurs just before merging from a transient parent entity into the object in the session cache
static int BEFORE_REFRESH
          A cascade point that occurs just after locking a transient parent entity into the session cache
 
Constructor Summary
Cascade(CascadingAction action, int cascadeTo, EventSource eventSource)
           
 
Method Summary
 void cascade(EntityPersister persister, Object parent)
          Cascade an action from the parent entity instance to all its children.
 void cascade(EntityPersister persister, Object parent, Object anything)
          Cascade an action from the parent entity instance to all its children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AFTER_INSERT_BEFORE_DELETE

public static final int AFTER_INSERT_BEFORE_DELETE
A cascade point that occurs just after the insertion of the parent entity and just before deletion

See Also:
Constant Field Values

BEFORE_INSERT_AFTER_DELETE

public static final int BEFORE_INSERT_AFTER_DELETE
A cascade point that occurs just before the insertion of the parent entity and just after deletion

See Also:
Constant Field Values

AFTER_INSERT_BEFORE_DELETE_VIA_COLLECTION

public static final int AFTER_INSERT_BEFORE_DELETE_VIA_COLLECTION
A cascade point that occurs just after the insertion of the parent entity and just before deletion, inside a collection

See Also:
Constant Field Values

AFTER_UPDATE

public static final int AFTER_UPDATE
A cascade point that occurs just after update of the parent entity

See Also:
Constant Field Values

BEFORE_FLUSH

public static final int BEFORE_FLUSH
A cascade point that occurs just before the session is flushed

See Also:
Constant Field Values

AFTER_EVICT

public static final int AFTER_EVICT
A cascade point that occurs just after eviction of the parent entity from the session cache

See Also:
Constant Field Values

BEFORE_REFRESH

public static final int BEFORE_REFRESH
A cascade point that occurs just after locking a transient parent entity into the session cache

See Also:
Constant Field Values

AFTER_LOCK

public static final int AFTER_LOCK
A cascade point that occurs just after refreshing a parent entity

See Also:
Constant Field Values

BEFORE_MERGE

public static final int BEFORE_MERGE
A cascade point that occurs just before merging from a transient parent entity into the object in the session cache

See Also:
Constant Field Values
Constructor Detail

Cascade

public Cascade(CascadingAction action,
               int cascadeTo,
               EventSource eventSource)
Method Detail

cascade

public void cascade(EntityPersister persister,
                    Object parent)
             throws HibernateException
Cascade an action from the parent entity instance to all its children.

Parameters:
persister - The parent's entity persister
parent - The parent reference.
Throws:
HibernateException

cascade

public void cascade(EntityPersister persister,
                    Object parent,
                    Object anything)
             throws HibernateException
Cascade an action from the parent entity instance to all its children. This form is typicaly called from within cascade actions.

Parameters:
persister - The parent's entity persister
parent - The parent reference.
anything - Anything ;) Typically some form of cascade-local cache which is specific to each CascadingAction type
Throws:
HibernateException