Package edu.caltech.nanodb.relations
Enum ForeignKeyValueChangeOption
- java.lang.Object
-
- java.lang.Enum<ForeignKeyValueChangeOption>
-
- edu.caltech.nanodb.relations.ForeignKeyValueChangeOption
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ForeignKeyValueChangeOption>
public enum ForeignKeyValueChangeOption extends java.lang.Enum<ForeignKeyValueChangeOption>
An enumeration specifying the options allowed for ON DELETE and ON UPDATE actions for foreign keys.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CASCADE
Delete or update the row from the parent table and automatically delete/update the matching rows in the child tableRESTRICT
Rejects the delete or update command on the parent tableSET_NULL
Delete or update the row from the parent table and set the foreign key column(s) in the child table to NULL
-
Field Summary
Fields Modifier and Type Field Description private byte
typeID
The ID of the option type.
-
Constructor Summary
Constructors Modifier Constructor Description private
ForeignKeyValueChangeOption(int typeID)
Construct a new @code{ForeignKeyValueChangeOption} instance with the specified option ID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ForeignKeyValueChangeOption
findType(int typeID)
Given the specified ID, this method returns the corresponding constraint type enum value, or it returnsnull
if the type value doesn't signify any constraint type in this enumeration.byte
getTypeID()
Returns the option's unique ID.static ForeignKeyValueChangeOption
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ForeignKeyValueChangeOption[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RESTRICT
public static final ForeignKeyValueChangeOption RESTRICT
Rejects the delete or update command on the parent table
-
CASCADE
public static final ForeignKeyValueChangeOption CASCADE
Delete or update the row from the parent table and automatically delete/update the matching rows in the child table
-
SET_NULL
public static final ForeignKeyValueChangeOption SET_NULL
Delete or update the row from the parent table and set the foreign key column(s) in the child table to NULL
-
-
Constructor Detail
-
ForeignKeyValueChangeOption
private ForeignKeyValueChangeOption(int typeID)
Construct a new @code{ForeignKeyValueChangeOption} instance with the specified option ID. Each option should have a unique ID. Note that this constructor is private, since this is the only place where foreign option types should be declared.
-
-
Method Detail
-
values
public static ForeignKeyValueChangeOption[] 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 (ForeignKeyValueChangeOption c : ForeignKeyValueChangeOption.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ForeignKeyValueChangeOption valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getTypeID
public byte getTypeID()
Returns the option's unique ID.
-
findType
public static ForeignKeyValueChangeOption findType(int typeID)
Given the specified ID, this method returns the corresponding constraint type enum value, or it returnsnull
if the type value doesn't signify any constraint type in this enumeration.
-
-