Enum Class DeleteRule

java.lang.Object
java.lang.Enum<DeleteRule>
org.apache.cayenne.map.DeleteRule
All Implemented Interfaces:
Serializable, Comparable<DeleteRule>, Constable

public enum DeleteRule extends Enum<DeleteRule>
Defines what happens to the target objects of an ObjRelationship when the source object is deleted. A relationship with no delete rule takes no action on its target objects.
  • Enum Constant Details

    • NULLIFY

      public static final DeleteRule NULLIFY
      Remove the reference that the destination has to this source (if the inverse relationship is toOne, nullify, if toMany, remove the source object)
    • CASCADE

      public static final DeleteRule CASCADE
      Delete the destination object(s)
    • DENY

      public static final DeleteRule DENY
      If the relationship has any objects (toOne or toMany), deny the delete. (Destination objects would therefore have to be deleted manually first)
  • Field Details

    • DEFAULT_DELETE_RULE_TO_MANY

      public static final DeleteRule 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
    • DEFAULT_DELETE_RULE_TO_ONE

      public static final DeleteRule 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
  • Method Details

    • values

      public static DeleteRule[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DeleteRule valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null