Enum Class ForeignKeyAction

java.lang.Object
java.lang.Enum<ForeignKeyAction>
org.tentackle.sql.metadata.ForeignKeyAction
All Implemented Interfaces:
Serializable, Comparable<ForeignKeyAction>, Constable

public enum ForeignKeyAction extends Enum<ForeignKeyAction>
Enum for foreign key actions.
Author:
harald
  • Enum Constant Details

    • CASCADE

      public static final ForeignKeyAction CASCADE
      When the primary key is updated, the foreign key (imported key) is changed to agree with it.
    • RESTRICT

      public static final ForeignKeyAction RESTRICT
      The primary key may not be updated if it has been imported by another table as a foreign key.
    • SET_NULL

      public static final ForeignKeyAction SET_NULL
      When the primary key is updated or deleted, the foreign key (imported key) is changed to NULL..
    • NO_ACTION

      public static final ForeignKeyAction NO_ACTION
      If the primary key has been imported, it cannot be updated or deleted.
    • SET_DEFAULT

      public static final ForeignKeyAction SET_DEFAULT
      If the primary key is updated or deleted, the foreign key (imported key) is set to the default value.
    • INITIALLY_DEFERRED

      public static final ForeignKeyAction INITIALLY_DEFERRED
      Indicates deferrability. See SQL-92 for a definition.
    • INITIALLY_IMMEDIATE

      public static final ForeignKeyAction INITIALLY_IMMEDIATE
      Indicates deferrability. See SQL-92 for a definition.
    • NOT_DEFERRABLE

      public static final ForeignKeyAction NOT_DEFERRABLE
      Indicates deferrability. See SQL-92 for a definition.
  • Method Details

    • values

      public static ForeignKeyAction[] 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

      public static ForeignKeyAction valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getAction

      public int getAction()
      Gets the action code.
      Returns:
      the action code
    • getSql

      public String getSql()
      Gets the SQL code.
      Returns:
      the sql
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ForeignKeyAction>
    • createFromAction

      public static ForeignKeyAction createFromAction(int action)
      Creates a foreign key action from an action code.
      Parameters:
      action - the code
      Returns:
      the foreign key action, null if invalid code