public abstract class TupleSerialKeyCreator 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.
Modifier and Type | Field and Description |
---|---|
protected SerialBinding |
dataBinding |
Constructor and Description |
---|
TupleSerialKeyCreator(ClassCatalog classCatalog,
java.lang.Class dataClass)
Creates a tuple-serial key creator.
|
TupleSerialKeyCreator(SerialBinding dataBinding)
Creates a tuple-serial 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,
java.lang.Object dataInput,
TupleOutput indexKeyOutput)
Creates the index key entry from primary key tuple entry and
deserialized data entry.
|
java.lang.Object |
nullifyForeignKey(java.lang.Object data)
Clears the index key in the deserialized data entry.
|
boolean |
nullifyForeignKey(SecondaryDatabase db,
DatabaseEntry dataEntry)
Javadoc for this public method is generated via
the doc templates in the doc_src directory.
|
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
protected SerialBinding dataBinding
public TupleSerialKeyCreator(ClassCatalog classCatalog, java.lang.Class dataClass)
classCatalog
- is the catalog to hold shared class information and
for a database should be a StoredClassCatalog
.dataClass
- is the data base class.public TupleSerialKeyCreator(SerialBinding dataBinding)
dataBinding
- is the data binding.public boolean createSecondaryKey(SecondaryDatabase db, DatabaseEntry primaryKeyEntry, DatabaseEntry dataEntry, DatabaseEntry indexKeyEntry) throws DatabaseException
SecondaryKeyCreator
createSecondaryKey
in interface SecondaryKeyCreator
DatabaseException
public boolean nullifyForeignKey(SecondaryDatabase db, DatabaseEntry dataEntry) throws DatabaseException
ForeignKeyNullifier
nullifyForeignKey
in interface ForeignKeyNullifier
DatabaseException
public abstract boolean createSecondaryKey(TupleInput primaryKeyInput, java.lang.Object dataInput, TupleOutput indexKeyOutput)
primaryKeyInput
- is the TupleInput
for the primary key
entry, or null if no primary key entry is used to construct the index
key.dataInput
- is the deserialized data entry, or null if no data
entry is used to construct the index key.indexKeyOutput
- is the destination index key tuple. For index
keys which are optionally present, no tuple entry should be output to
indicate that the key is not present or null.public java.lang.Object nullifyForeignKey(java.lang.Object data)
On entry the data parameter contains the index key to be cleared. It
should be changed 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.
data
- is the source and destination deserialized data
entry.