public enum ConstraintMode extends Enum<ConstraintMode>
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').
DbForeignKey| Enum Constant and Description |
|---|
CASCADE
Cascade - To automatically cascade a delete of a referenced id.
|
RESTRICT
Restrict - The usual default behavior for foreign constraints (also known as 'No Action').
|
SET_DEFAULT
Set the value to 'default' when a referenced id is deleted.
|
SET_NULL
Set the value to null when a referenced id is deleted.
|
| Modifier and Type | Method and Description |
|---|---|
static ConstraintMode |
valueOf(String name)
Returns 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.
|
public static final ConstraintMode RESTRICT
public static final ConstraintMode SET_NULL
public static final ConstraintMode SET_DEFAULT
public static final ConstraintMode CASCADE
public static ConstraintMode[] values()
for (ConstraintMode c : ConstraintMode.values()) System.out.println(c);
public static ConstraintMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2019. All rights reserved.