Enum Class SQLReferenceOption
- All Implemented Interfaces:
Serializable
,Comparable<SQLReferenceOption>
,Constable
SQL Reference Option represents a Reference Option in MySQL
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDelete or update the row from the parent table and automatically delete or update the matching rows in the child table - CASCADERejects the delete or update operation for the parent table.Rejects the delete or update operation for the parent table.This action is recognized by the MySQL parser, but both InnoDB and NDB reject table definitions containing this - SET DEFAULTDelete or update the row from the parent table and set the foreign key column or columns in the child table to NULL - SET NULL -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
SQLReferenceOption
(String option) Constructs a newSQLReferenceOption
with the given parameter -
Method Summary
Modifier and TypeMethodDescriptionstatic SQLReferenceOption
fromOption
(String option) Find aSQLReferenceOption
with the given option valuetoString()
static SQLReferenceOption
Returns the enum constant of this class with the specified name.static SQLReferenceOption[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RESTRICT
Rejects the delete or update operation for the parent table. This is also the default operation - RESTRICT -
CASCADE
Delete or update the row from the parent table and automatically delete or update the matching rows in the child table - CASCADE -
SET_NULL
Delete or update the row from the parent table and set the foreign key column or columns in the child table to NULL - SET NULL -
NO_ACTION
Rejects the delete or update operation for the parent table. This is the same asRESTRICT
- NO ACTION -
SET_DEFAULT
This action is recognized by the MySQL parser, but both InnoDB and NDB reject table definitions containing this - SET DEFAULT
-
-
Field Details
-
option
The option value
-
-
Constructor Details
-
SQLReferenceOption
Constructs a newSQLReferenceOption
with the given parameter- Parameters:
option
- The option value
-
-
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
-
fromOption
Find aSQLReferenceOption
with the given option value- Parameters:
option
- The option value to find- Returns:
- The found
SQLReferenceOption
or null
-
toString
- Overrides:
toString
in classEnum<SQLReferenceOption>
-