c final int CASCADE_ON_UPDATE = 0;
/**
* A cascade point that occurs just after eviction of the parent entity from the
* session cache
*/
public static final int CASCADE_ON_EVICT = 0;
/**
* A cascade point that occurs just after locking a transient parent entity into the
* session cache
*/
public static final int CASCADE_ON_LOCK = 0;
/**
* A cascade point that occurs just after copying from a transient parent entity into
* the object in the session cache
*/
public static final int CASCADE_ON_COPY = 0;
// The allowable cascade styles for a property:
/**
* A style of cascade that can be specified by the mapping for an association.
* The style is specified by the <tt>cascade</tt> attribute in the mapping file.
*/
public abstract static class CascadeStyle {
protected CascadeStyle() {}
/**
* Should the given action be cascaded?
*/
abstract boolean doCascade(CascadingAction action);
/**
* Should we cascade to this particular child?
*/
/*boolean doCascade(SessionImplementor session, Object child)
throws HibernateException {
return true;
};*/
boolean hasOrphanDelete() {
return false;
}
}
/**
* save / delete / update / evict / lock / replicate + delete orphans
*/
public static final CascadeStyle STYLE_ALL_DELETE_ORPHAN = new CascadeStyle() {
boolean doCascade(CascadingAction action) {
return true;
}
boolean hasOrphanDelete() {
return true;
}
};
/**
* save / delete / update / evict / lock / replicate
*/
public static final CascadeStyle STYLE_ALL = new CascadeStyle() {
boolean doCascade(CascadingAction action) {
return true;
}
};
/**
* save / update
上一篇:
CascadeEnum.java
下一篇:
浮生若萍