Enum Class OnDeleteAction

java.lang.Object
java.lang.Enum<OnDeleteAction>
org.hibernate.annotations.OnDeleteAction
All Implemented Interfaces:
Serializable, Comparable<OnDeleteAction>, Constable

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:
  • Enum Constant Details

    • 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 Details

    • values

      public static OnDeleteAction[] 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 OnDeleteAction 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
    • getAlternativeName

      public String getAlternativeName()
    • toSqlString

      public String toSqlString()
    • fromExternalForm

      public static OnDeleteAction fromExternalForm(Object value)