Enum ForeignKeyAction

    • Enum Constant Detail

      • 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 Detail

      • values

        public static ForeignKeyAction[] 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 (ForeignKeyAction c : ForeignKeyAction.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ForeignKeyAction 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 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
      • 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