A session action that may be cascaded from parent entity to its children
| Field Summary |
|---|
| public static final CascadingAction | DELETE | Also see:
- org.hibernate.Session#delete(Object)
|
| public static final CascadingAction | LOCK | Also see:
- org.hibernate.Session#lock(Object, LockMode)
|
| public static final CascadingAction | REFRESH | Also see:
- org.hibernate.Session#refresh(Object)
|
| public static final CascadingAction | EVICT | Also see:
- org.hibernate.Session#evict(Object)
|
| public static final CascadingAction | SAVE_UPDATE | Also see:
- org.hibernate.Session#saveOrUpdate(Object)
|
| public static final CascadingAction | MERGE | Also see:
- org.hibernate.Session#merge(Object)
|
| public static final CascadingAction | SAVE_UPDATE_COPY | Also see:
- org.hibernate.classic.Session#saveOrUpdateCopy(Object)
|
| public static final CascadingAction | PERSIST | Also see:
- org.hibernate.Session#persist(Object)
|
| public static final CascadingAction | PERSIST_ON_FLUSH | Execute persist during flush timeAlso see:
- org.hibernate.Session#persist(Object)
|
| public static final CascadingAction | REPLICATE | Also see:
- org.hibernate.Session#replicate(Object, org.hibernate.ReplicationMode)
|
| Method from org.hibernate.engine.CascadingAction Detail: |
abstract public void cascade(EventSource session,
Object child,
String entityName,
Object anything,
boolean isCascadeDeleteEnabled) throws HibernateException
Cascade the action to the child object. |
abstract public boolean deleteOrphans()
Does this action potentially extrapolate to orphan deletes? |
abstract public Iterator getCascadableChildrenIterator(EventSource session,
CollectionType collectionType,
Object collection)
Given a collection, get an iterator of the children upon which the
current cascading action should be visited. |
public static Iterator getLoadedElementsIterator(SessionImplementor session,
CollectionType collectionType,
Object collection) {
if ( collectionIsInitialized(collection) ) {
// handles arrays and newly instantiated collections
return collectionType.getElementsIterator(collection, session);
}
else {
// does not handle arrays (thats ok, cos they can't be lazy)
// or newly instantiated collections, so we can do the cast
return ( (PersistentCollection) collection ).queuedAdditionIterator();
}
}
Iterate just the elements of the collection that are already there. Don't load
any new elements from the database. |
public void noCascade(EventSource session,
Object child,
Object parent,
EntityPersister persister,
int propertyIndex) {
}
Called (in the case of #requiresNoCascadeChecking returning true) to validate
that no cascade on the given property is considered a valid semantic. |
public boolean performOnLazyProperty() {
return true;
}
Should this action be performed (or noCascade consulted) in the case of lazy properties. |
public boolean requiresNoCascadeChecking() {
return false;
}
Does the specified cascading action require verification of no cascade validity? |