Enum OnDeleteAction

  • All Implemented Interfaces:
    Serializable, Comparable<OnDeleteAction>

    public enum OnDeleteAction
    extends Enum<OnDeleteAction>
    Enumerates the possible actions for the on delete clause of a foreign key constraint. Specifies what action the database should take when deletion of a row would result in a violation of the constraint.
    See Also:
    OnDelete
    • Enum Constant Detail

      • NO_ACTION

        public static final OnDeleteAction NO_ACTION
        No action. The default. An error is raised if rows still reference the parent when the constraint is checked, possibly later in the transaction.
      • CASCADE

        public static final OnDeleteAction CASCADE
        Cascade deletion of the parent to the child.
      • RESTRICT

        public static final OnDeleteAction RESTRICT
        Prevents deletion of the parent by raising an error immediately.
        Since:
        6.2
      • SET_NULL

        public static final OnDeleteAction SET_NULL
        Set the referencing foreign key to null.
        Since:
        6.2
      • SET_DEFAULT

        public static final OnDeleteAction SET_DEFAULT
        Set the referencing foreign key to its default value.
        Since:
        6.2
    • Method Detail

      • values

        public static OnDeleteAction[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (OnDeleteAction c : OnDeleteAction.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OnDeleteAction valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • getAlternativeName

        public String getAlternativeName()
      • toSqlString

        public String toSqlString()