Package org.apache.cayenne.map
Class DeleteRule
java.lang.Object
org.apache.cayenne.map.DeleteRule
public class DeleteRule extends Object
Defines constants for the possible values of ObjRelationship delete rules.
- 
Field SummaryFields Modifier and Type Field Description static intCASCADEDelete the destination object(s)static intDEFAULT_DELETE_RULE_TO_MANYDefault delete rule for one-to-many relationships.static intDEFAULT_DELETE_RULE_TO_ONEDefault delete rule for many-to-one relationships.static intDENYIf the relationship has any objects (toOne or toMany), deny the delete.static intNO_ACTIONstatic intNULLIFYRemove the reference that the destination has to this source (if the inverse relationship is toOne, nullify, if toMany, remove the source object)
- 
Constructor SummaryConstructors Constructor Description DeleteRule()
- 
Method SummaryModifier and Type Method Description static intdeleteRuleForName(String name)Translates a possible delete rule name (typically returned from deleteRuleName at some stage), into a deleteRule constantstatic StringdeleteRuleName(int deleteRule)Returns String label for a delete rule state.
- 
Field Details- 
NO_ACTIONpublic static final int NO_ACTION- See Also:
- Constant Field Values
 
- 
NULLIFYpublic static final int NULLIFYRemove the reference that the destination has to this source (if the inverse relationship is toOne, nullify, if toMany, remove the source object)- See Also:
- Constant Field Values
 
- 
CASCADEpublic static final int CASCADEDelete the destination object(s)- See Also:
- Constant Field Values
 
- 
DENYpublic static final int DENYIf the relationship has any objects (toOne or toMany), deny the delete. (Destination objects would therefore have to be deleted manually first)- See Also:
- Constant Field Values
 
- 
DEFAULT_DELETE_RULE_TO_MANYpublic static final int DEFAULT_DELETE_RULE_TO_MANYDefault delete rule for one-to-many relationships. It is used when new rels are created via modeler, or when synchrozining Obj- and DbEntities- See Also:
- Constant Field Values
 
- 
DEFAULT_DELETE_RULE_TO_ONEpublic static final int DEFAULT_DELETE_RULE_TO_ONEDefault delete rule for many-to-one relationships. It is used when new rels are created via modeler, or when synchrozining Obj- and DbEntities- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details- 
DeleteRulepublic DeleteRule()
 
- 
- 
Method Details- 
deleteRuleNameReturns String label for a delete rule state. Used for save/load (xml), display in modeler etc. Must remain the same, or else great care taken with loading old maps.
- 
deleteRuleForNameTranslates a possible delete rule name (typically returned from deleteRuleName at some stage), into a deleteRule constant
 
-