- All Implemented Interfaces:
Serializable,Comparable<ConstraintMode>
Modes for the DbForeignKey onDelete and onUpdate clause of a foreign keys.
Note that we should never change the onUpdate clause as primary keys
should never change. Instead review the design ensuring the primary keys are immutable.
Always leave the onUpdate mode at it's default of RESTRICT ('No Action').
- See Also:
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCascade - To automatically cascade a delete of a referenced id.Restrict - The usual default behavior for foreign constraints (also known as 'No Action').Set the value to 'default' when a referenced id is deleted.Set the value to null when a referenced id is deleted. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConstraintModeReturns the enum constant of this type with the specified name.static ConstraintMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
RESTRICT
Restrict - The usual default behavior for foreign constraints (also known as 'No Action'). -
SET_NULL
Set the value to null when a referenced id is deleted. -
SET_DEFAULT
Set the value to 'default' when a referenced id is deleted. -
CASCADE
Cascade - To automatically cascade a delete of a referenced id.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-