|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sleepycat.bdb.bind.serial.SerialSerialKeyExtractor
A abstract key extractor that uses a serial key and a serial value. This class takes care of serializing and deserializing the key and value data automatically. Its two abstract methods must be implemented by a concrete subclass to extract/clear the index key from the deserialized data objects.
Constructor Summary | |
SerialSerialKeyExtractor(SerialFormat primaryKeyFormat,
SerialFormat valueFormat,
SerialFormat indexKeyFormat)
Creates a serial-serial entity binding. |
Method Summary | |
void |
clearIndexKey(DataBuffer valueData)
Clears the index key in a value buffer. |
abstract Object |
clearIndexKey(Object valueData)
Clears the index key in a value data object. |
void |
extractIndexKey(DataBuffer primaryKeyData,
DataBuffer valueData,
DataBuffer indexKeyData)
Extracts the index key data from primary key and value buffers. |
abstract Object |
extractIndexKey(Object primaryKeyData,
Object valueData)
Extracts the index key data object from primary key and value data objects. |
DataFormat |
getIndexKeyFormat()
Returns the format of the index key data. |
DataFormat |
getPrimaryKeyFormat()
Returns the format of the primary key data or null if the index key data is not derived from the primary key data. |
DataFormat |
getValueFormat()
Returns the format of the value data or null if the index key data is not derived from the value data. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SerialSerialKeyExtractor(SerialFormat primaryKeyFormat, SerialFormat valueFormat, SerialFormat indexKeyFormat)
primaryKeyFormat
- is the primary key format, or null if no
primary key data is used to construct the index key.valueFormat
- is the value format, or null if no value data is
used to construct the index key.indexKeyFormat
- is the index key format.Method Detail |
public DataFormat getPrimaryKeyFormat()
KeyExtractor
primaryKeyData
parameter
of KeyExtractor.extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)
.
getPrimaryKeyFormat
in interface KeyExtractor
public DataFormat getValueFormat()
KeyExtractor
valueData
parameter of KeyExtractor.extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)
.
getValueFormat
in interface KeyExtractor
public DataFormat getIndexKeyFormat()
KeyExtractor
getIndexKeyFormat
in interface KeyExtractor
public void extractIndexKey(DataBuffer primaryKeyData, DataBuffer valueData, DataBuffer indexKeyData) throws IOException
KeyExtractor
extractIndexKey
in interface KeyExtractor
primaryKeyData
- is the source primary key data, or null if no
primary key data is used to construct the index key, in which case
KeyExtractor.getPrimaryKeyFormat()
should also return null.valueData
- is the source value data, or null if no value data is
used to construct the index key, in which case KeyExtractor.getValueFormat()
should also return null.indexKeyData
- is the destination index key buffer. For index keys
which are optionally present, the buffer's length should be set to zero
to indicate that the key is not present or null.
IOException
public void clearIndexKey(DataBuffer valueData) throws IOException
KeyExtractor
ForeignKeyIndex
is configured with ForeignKeyIndex.ON_DELETE_CLEAR
. It is never called
for index keys that are derived from primary key data, since in this
case ForeignKeyIndex.ON_DELETE_CLEAR
is not
allowed.
clearIndexKey
in interface KeyExtractor
valueData
- is the source and destination value data. On entry
this contains the index key to be cleared. It should be changed by this
method such that KeyExtractor.extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)
will extract a null key (set
the buffer length to zero). Other data in the buffer should remain
unchanged.
IOException
public abstract Object extractIndexKey(Object primaryKeyData, Object valueData) throws IOException
primaryKeyData
- is the deserialized source primary key data, or
null if no primary key data is used to construct the index key.valueData
- is the deserialized source value data, or null if no
value data is used to construct the index key.
IOException
public abstract Object clearIndexKey(Object valueData) throws IOException
valueData
- is the source and destination value data object.
IOException
|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |