public abstract class SerialSerialKeyCreator extends java.lang.Object implements SecondaryKeyCreator, ForeignKeyNullifier
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 |
protected SerialBinding |
indexKeyBinding |
protected SerialBinding |
primaryKeyBinding |
Constructor and Description |
---|
SerialSerialKeyCreator(ClassCatalog classCatalog,
java.lang.Class primaryKeyClass,
java.lang.Class dataClass,
java.lang.Class indexKeyClass)
Creates a serial-serial key creator.
|
SerialSerialKeyCreator(SerialBinding primaryKeyBinding,
SerialBinding dataBinding,
SerialBinding indexKeyBinding)
Creates a serial-serial entity binding.
|
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Object |
createSecondaryKey(java.lang.Object primaryKey,
java.lang.Object data)
Creates the index key object from primary key and entry objects.
|
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.
|
java.lang.Object |
nullifyForeignKey(java.lang.Object data)
Clears the index key in a data object.
|
boolean |
nullifyForeignKey(SecondaryDatabase db,
DatabaseEntry dataEntry)
Javadoc for this public method is generated via
the doc templates in the doc_src directory.
|
protected SerialBinding primaryKeyBinding
protected SerialBinding dataBinding
protected SerialBinding indexKeyBinding
public SerialSerialKeyCreator(ClassCatalog classCatalog, java.lang.Class primaryKeyClass, java.lang.Class dataClass, java.lang.Class indexKeyClass)
classCatalog
- is the catalog to hold shared class information and
for a database should be a StoredClassCatalog
.primaryKeyClass
- is the primary key base class.dataClass
- is the data base class.indexKeyClass
- is the index key base class.public SerialSerialKeyCreator(SerialBinding primaryKeyBinding, SerialBinding dataBinding, SerialBinding indexKeyBinding)
primaryKeyBinding
- is the primary key binding.dataBinding
- is the data binding.indexKeyBinding
- is the index key 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 java.lang.Object createSecondaryKey(java.lang.Object primaryKey, java.lang.Object data)
primaryKey
- is the deserialized source primary key entry, or
null if no primary key entry is used to construct the index key.data
- is the deserialized source data entry, or null if no
data entry is used to construct the index key.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 data object.