Berkeley DB Java Edition
version 5.0.34

com.sleepycat.je
Enum ForeignKeyDeleteAction

java.lang.Object
  extended by java.lang.Enum<ForeignKeyDeleteAction>
      extended by com.sleepycat.je.ForeignKeyDeleteAction
All Implemented Interfaces:
Serializable, Comparable<ForeignKeyDeleteAction>

public enum ForeignKeyDeleteAction
extends Enum<ForeignKeyDeleteAction>

The action taken when a referenced record in the foreign key database is deleted.

The delete action applies to a secondary database that is configured to have a foreign key integrity constraint. The delete action is specified by calling SecondaryConfig.setForeignKeyDeleteAction(com.sleepycat.je.ForeignKeyDeleteAction).

When a record in the foreign key database is deleted, it is checked to see if it is referenced by any record in the associated secondary database. If the key is referenced, the delete action is applied. By default, the delete action is ABORT.

See Also:
SecondaryConfig

Enum Constant Summary
ABORT
          When a referenced record in the foreign key database is deleted, abort the transaction by throwing a DeleteConstraintException.
CASCADE
          When a referenced record in the foreign key database is deleted, delete the primary database record that references it.
NULLIFY
          When a referenced record in the foreign key database is deleted, set the reference to null in the primary database record that references it, thereby deleting the secondary key.
 
Method Summary
 String toString()
           
static ForeignKeyDeleteAction valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ForeignKeyDeleteAction[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ABORT

public static final ForeignKeyDeleteAction ABORT
When a referenced record in the foreign key database is deleted, abort the transaction by throwing a DeleteConstraintException.


CASCADE

public static final ForeignKeyDeleteAction CASCADE
When a referenced record in the foreign key database is deleted, delete the primary database record that references it.


NULLIFY

public static final ForeignKeyDeleteAction NULLIFY
When a referenced record in the foreign key database is deleted, set the reference to null in the primary database record that references it, thereby deleting the secondary key. @see ForeignKeyNullifier @see ForeignMultiKeyNullifier

Method Detail

values

public static ForeignKeyDeleteAction[] 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 (ForeignKeyDeleteAction c : ForeignKeyDeleteAction.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ForeignKeyDeleteAction 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

toString

public String toString()
Overrides:
toString in class Enum<ForeignKeyDeleteAction>

Berkeley DB Java Edition
version 5.0.34

Copyright (c) 2004-2011 Oracle. All rights reserved.