|
|
|
Berkeley DB version 4.4.20 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sleepycat.bind.tuple.TupleBase com.sleepycat.bind.serial.TupleSerialKeyCreator
A abstract key creator that uses a tuple key and a serial data entry. This
class takes care of serializing and deserializing the data entry, and
converting the key entry to/from TupleInput
and TupleOutput
objects.
The following abstract method must be implemented by a concrete subclass
to create the index key using these objects
Field Summary | |
protected SerialBinding |
dataBinding
|
Constructor Summary | |
TupleSerialKeyCreator(ClassCatalog classCatalog,
Class dataClass)
Creates a tuple-serial key creator. |
|
TupleSerialKeyCreator(SerialBinding dataBinding)
Creates a tuple-serial key creator. |
Method Summary | |
boolean |
createSecondaryKey(SecondaryDatabase db,
DatabaseEntry primaryKeyEntry,
DatabaseEntry dataEntry,
DatabaseEntry indexKeyEntry)
Creates a secondary key entry, given a primary key and data entry. |
abstract boolean |
createSecondaryKey(TupleInput primaryKeyInput,
Object dataInput,
TupleOutput indexKeyOutput)
Creates the index key entry from primary key tuple entry and deserialized data entry. |
Object |
nullifyForeignKey(Object data)
Clears the index key in the deserialized data entry. |
boolean |
nullifyForeignKey(SecondaryDatabase db,
DatabaseEntry dataEntry)
|
Methods inherited from class com.sleepycat.bind.tuple.TupleBase |
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SerialBinding dataBinding
Constructor Detail |
public TupleSerialKeyCreator(ClassCatalog classCatalog, 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.Method Detail |
public boolean createSecondaryKey(SecondaryDatabase db, DatabaseEntry primaryKeyEntry, DatabaseEntry dataEntry, DatabaseEntry indexKeyEntry) throws DatabaseException
SecondaryKeyCreator
createSecondaryKey
in interface SecondaryKeyCreator
db
- the database to which the secondary key will be added.
primaryKeyEntry
- the primary key entry. This parameter must not be modified
by this method.
dataEntry
- the primary data entry. This parameter must not be modified
by this method.
indexKeyEntry
- the secondary key created by this method.
DatabaseException
- if an error occurs attempting to create the
secondary key.public boolean nullifyForeignKey(SecondaryDatabase db, DatabaseEntry dataEntry) throws DatabaseException
DatabaseException
public abstract boolean createSecondaryKey(TupleInput primaryKeyInput, 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 Object nullifyForeignKey(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.db.SecondaryDatabase, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)
will return false. Other fields in the data object should remain
unchanged.
data
- is the source and destination deserialized data
entry.
|
Berkeley DB version 4.4.20 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |