Package org.hibernate.annotations
Enum Class OnDeleteAction
- All Implemented Interfaces:
Serializable
,Comparable<OnDeleteAction>
,Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCascade deletion of the parent to the child.No action.Prevents deletion of the parent by raising an error immediately.Set the referencing foreign key to its default value.Set the referencing foreign key to null. -
Method Summary
Modifier and TypeMethodDescriptionstatic OnDeleteAction
fromExternalForm
(Object value) static OnDeleteAction
Returns the enum constant of this class with the specified name.static OnDeleteAction[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Cascade deletion of the parent to the child. -
RESTRICT
Prevents deletion of the parent by raising an error immediately.- Since:
- 6.2
-
SET_NULL
Set the referencing foreign key to null.- Since:
- 6.2
-
SET_DEFAULT
Set the referencing foreign key to its default value.- Since:
- 6.2
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getAlternativeName
-
toSqlString
-
fromExternalForm
-