Package org.hibernate.annotations
Enum OnDeleteAction
- java.lang.Object
-
- java.lang.Enum<OnDeleteAction>
-
- org.hibernate.annotations.OnDeleteAction
-
- All Implemented Interfaces:
Serializable,Comparable<OnDeleteAction>
public enum OnDeleteAction extends Enum<OnDeleteAction>
Enumerates the possible actions for theon deleteclause 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 Summary
Enum Constants Enum Constant Description CASCADECascade deletion of the parent to the child.NO_ACTIONNo action.RESTRICTPrevents deletion of the parent by raising an error immediately.SET_DEFAULTSet the referencing foreign key to its default value.SET_NULLSet the referencing foreign key to null.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OnDeleteActionfromExternalForm(Object value)StringgetAlternativeName()StringtoSqlString()static OnDeleteActionvalueOf(String name)Returns the enum constant of this type with the specified name.static OnDeleteAction[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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 nameNullPointerException- if the argument is null
-
getAlternativeName
public String getAlternativeName()
-
toSqlString
public String toSqlString()
-
fromExternalForm
public static OnDeleteAction fromExternalForm(Object value)
-
-