Berkeley DB Java Edition
version 1.5.1

com.sleepycat.je
Interface ForeignKeyNullifier

All Known Implementing Classes:
SerialSerialKeyCreator, TupleSerialKeyCreator, TupleTupleKeyCreator

public interface ForeignKeyNullifier

The interface implemented for setting foreign key references to null.

A key nullifier is used with a secondary database that is configured to have a foreign key integrity constraint and a delete action of ForeignKeyDeleteAction.NULLIFY. The key nullifier is specified by calling SecondaryConfig.setForeignKeyNullifier(com.sleepycat.je.ForeignKeyNullifier).

When a referenced record in the foreign key database is deleted and the foreign key delete action is NULLIFY, the nullifyForeignKey(com.sleepycat.je.SecondaryDatabase, com.sleepycat.je.DatabaseEntry) method is called. This method sets the foreign key reference to null in the datum of the primary database. The primary database is then updated to contain the modified datum. The result is that the secondary key is deleted.


Method Summary
 boolean nullifyForeignKey(SecondaryDatabase secondary, DatabaseEntry data)
          Sets the foreign key reference to null in the datum of the primary database.
 

Method Detail

nullifyForeignKey

public boolean nullifyForeignKey(SecondaryDatabase secondary,
                                 DatabaseEntry data)
                          throws DatabaseException
Sets the foreign key reference to null in the datum of the primary database.

Parameters:
secondary - the database in which the foreign key integrity constraint is defined.
data - the existing primary key datum in which the foreign key reference should be set to null.
Returns:
true if the datum was modified, or false to indicate that the key is not present.
Throws:
DatabaseException - if an error occurs attempting to clear the key reference.

Berkeley DB Java Edition
version 1.5.1

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.