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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CASCADE` Delete the destination object(s)
    `static int` | `DEFAULT_DELETE_RULE_TO_MANY` Default delete rule for one-to-many relationships.
    `static int` | `DEFAULT_DELETE_RULE_TO_ONE` Default delete rule for many-to-one relationships.
    `static int` | `DENY` If the relationship has any objects (toOne or toMany), deny the delete.
    `static int` | `NO_ACTION`
    `static int` | `NULLIFY` Remove the reference that the destination has to this source (if the inverse relationship is toOne, nullify, if toMany, remove the source object)

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DeleteRule()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `deleteRuleForName(String name)` Translates a possible delete rule name (typically returned from deleteRuleName at some stage), into a deleteRule constant
    `static String` | `deleteRuleName(int deleteRule)` Returns String label for a delete rule state.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### NO_ACTION

          public static final int NO_ACTION

      See Also:
        Constant Field Values

    - #### NULLIFY

          public static final int NULLIFY

      Remove 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

    - #### CASCADE

          public static final int CASCADE

      Delete the destination object(s)
      See Also:
        Constant Field Values

    - #### DENY

          public static final int DENY

      If 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_MANY

          public static final int DEFAULT_DELETE_RULE_TO_MANY

      Default 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_ONE

          public static final int DEFAULT_DELETE_RULE_TO_ONE

      Default 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 Detail

    - #### DeleteRule

          public DeleteRule()

  - ### Method Detail

    - #### deleteRuleName

          public static String deleteRuleName(int deleteRule)

      Returns 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.

    - #### deleteRuleForName

          public static int deleteRuleForName(String name)

      Translates a possible delete rule name (typically returned from deleteRuleName at some stage), into a deleteRule constant

Copyright © 2001–2018 Apache Cayenne. All rights reserved.