Package io.ebean.annotation
Enum ConstraintMode
- java.lang.Object
-
- java.lang.Enum<ConstraintMode>
-
- io.ebean.annotation.ConstraintMode
-
- All Implemented Interfaces:
Serializable,Comparable<ConstraintMode>
public enum ConstraintMode extends Enum<ConstraintMode>
Modes for the DbForeignKey onDelete and onUpdate clause of a foreign keys.Note that we should never change the
onUpdateclause 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:
DbForeignKey
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CASCADECascade - To automatically cascade a delete of a referenced id.RESTRICTRestrict - The usual default behavior for foreign constraints (also known as 'No Action').SET_DEFAULTSet the value to 'default' when a referenced id is deleted.SET_NULLSet the value to null when a referenced id is deleted.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConstraintModevalueOf(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.
-
-
-
Enum Constant Detail
-
RESTRICT
public static final ConstraintMode RESTRICT
Restrict - The usual default behavior for foreign constraints (also known as 'No Action').
-
SET_NULL
public static final ConstraintMode SET_NULL
Set the value to null when a referenced id is deleted.
-
SET_DEFAULT
public static final ConstraintMode SET_DEFAULT
Set the value to 'default' when a referenced id is deleted.
-
CASCADE
public static final ConstraintMode CASCADE
Cascade - To automatically cascade a delete of a referenced id.
-
-
Method Detail
-
values
public static ConstraintMode[] 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 (ConstraintMode c : ConstraintMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConstraintMode 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
-
-