public interface SForeignMultiKeyNullifier
A key nullifier is used with a secondary database that is configured to
have a foreign key integrity constraint and a delete action of SForeignKeyDeleteAction.NULLIFY
. The key nullifier is specified by calling
SSecondaryConfig.setForeignMultiKeyNullifier(com.sleepycat.client.SForeignMultiKeyNullifier)
.
When a referenced record in the foreign key database is deleted and the
foreign key delete action is NULLIFY
, the nullifyForeignKey(com.sleepycat.client.SSecondaryDatabase, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SDatabaseEntry)
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.
This interface may be used along with SSecondaryKeyCreator
or SSecondaryMultiKeyCreator
for many-to-many, one-to-many, many-to-one and
one-to-one relationships.
Modifier and Type | Method and Description |
---|---|
boolean |
nullifyForeignKey(SSecondaryDatabase secondary,
SDatabaseEntry key,
SDatabaseEntry data,
SDatabaseEntry secKey)
Sets the foreign key reference to null in the datum of the primary
database.
|
boolean nullifyForeignKey(SSecondaryDatabase secondary, SDatabaseEntry key, SDatabaseEntry data, SDatabaseEntry secKey) throws SDatabaseException
secondary
- the database in which the foreign key integrity
constraint is defined. This parameter is passed for informational
purposes but is not commonly used.key
- the existing primary key. This parameter is passed for
informational purposes but is not commonly used.data
- the existing primary datum in which the foreign key
reference should be set to null. This parameter should be updated by
this method if it returns true.secKey
- the secondary key to be nullified. This parameter is
needed for knowing which key to nullify when multiple keys are present,
as when SSecondaryMultiKeyCreator
is used.SDatabaseException
- if an error occurs attempting to clear the
key reference.Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.