public abstract class TupleTupleKeyCreator extends TupleBase implements SecondaryKeyCreator, ForeignKeyNullifier
TupleInput and TupleOutput objects.
The following abstract method must be implemented by a concrete subclass
to create the index key using these objects
If ForeignKeyDeleteAction.NULLIFY was
specified when opening the secondary database, the following method must be
overridden to nullify the foreign index key. If NULLIFY was not specified,
this method need not be overridden.
If ForeignKeyDeleteAction.NULLIFY was
specified when creating the secondary, this method is called when the
entity for this foreign key is deleted. If NULLIFY was not specified,
this method will not be called and may always return false.
| Constructor and Description |
|---|
TupleTupleKeyCreator()
Creates a tuple-tuple key creator.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
createSecondaryKey(SecondaryDatabase db,
DatabaseEntry primaryKeyEntry,
DatabaseEntry dataEntry,
DatabaseEntry indexKeyEntry)
Javadoc for this public method is generated via
the doc templates in the doc_src directory.
|
abstract boolean |
createSecondaryKey(TupleInput primaryKeyInput,
TupleInput dataInput,
TupleOutput indexKeyOutput)
Creates the index key from primary key tuple and data tuple.
|
boolean |
nullifyForeignKey(SecondaryDatabase db,
DatabaseEntry dataEntry)
Javadoc for this public method is generated via
the doc templates in the doc_src directory.
|
boolean |
nullifyForeignKey(TupleInput dataInput,
TupleOutput dataOutput)
Clears the index key in the tuple data entry.
|
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSizepublic TupleTupleKeyCreator()
public boolean createSecondaryKey(SecondaryDatabase db, DatabaseEntry primaryKeyEntry, DatabaseEntry dataEntry, DatabaseEntry indexKeyEntry) throws DatabaseException
SecondaryKeyCreatorcreateSecondaryKey in interface SecondaryKeyCreatorDatabaseExceptionpublic boolean nullifyForeignKey(SecondaryDatabase db, DatabaseEntry dataEntry) throws DatabaseException
ForeignKeyNullifiernullifyForeignKey in interface ForeignKeyNullifierDatabaseExceptionpublic abstract boolean createSecondaryKey(TupleInput primaryKeyInput, TupleInput dataInput, TupleOutput indexKeyOutput)
primaryKeyInput - is the TupleInput for the primary key
entry.dataInput - is the TupleInput for the data entry.indexKeyOutput - is the destination index key tuple.public boolean nullifyForeignKey(TupleInput dataInput, TupleOutput dataOutput)
The secondary key should be output or removed by this method such
that createSecondaryKey(com.sleepycat.je.SecondaryDatabase, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry) will return false. Other fields in the
data object should remain unchanged.
dataInput - is the TupleInput for the data entry.dataOutput - is the destination TupleOutput.