com.sleepycat.bdb.bind.tuple
Interface MarshalledTupleKeyEntity


public interface MarshalledTupleKeyEntity

A marshalling interface implemented by entity classes that have tuple data keys. Since MarshalledTupleKeyEntity objects are instantiated by Java serialization, no particular contructor is required.

Note that a marshalled tuple key extractor is somewhat less efficient than a non-marshalled key tuple extractor because more conversions are needed. A marshalled key extractor must convert the data to an object in order to extract the key data, while an unmarshalled key extractor does not.

See Also:
TupleTupleMarshalledBinding, TupleTupleMarshalledKeyExtractor, TupleSerialMarshalledBinding, TupleSerialMarshalledKeyExtractor

Method Summary
 void clearIndexKey(java.lang.String keyName)
          Clears the entity's index key value for the given key name.
 void marshalIndexKey(java.lang.String keyName, TupleOutput keyOutput)
          Extracts the entity's index key and writes it to the key output.
 void marshalPrimaryKey(TupleOutput keyOutput)
          Extracts the entity's primary key and writes it to the key output.
 void unmarshalPrimaryKey(TupleInput keyInput)
          Completes construction of the entity by setting its primary key from the stored primary key.
 

Method Detail

marshalPrimaryKey

void marshalPrimaryKey(TupleOutput keyOutput)
                       throws java.io.IOException
Extracts the entity's primary key and writes it to the key output.

Parameters:
keyOutput - is the output tuple.
Throws:
java.io.IOException

unmarshalPrimaryKey

void unmarshalPrimaryKey(TupleInput keyInput)
                         throws java.io.IOException
Completes construction of the entity by setting its primary key from the stored primary key.

Parameters:
keyInput - is the input tuple.
Throws:
java.io.IOException

marshalIndexKey

void marshalIndexKey(java.lang.String keyName,
                     TupleOutput keyOutput)
                     throws java.io.IOException
Extracts the entity's index key and writes it to the key output.

Parameters:
keyName - identifies the index key.
keyOutput - is the output tuple.
Throws:
java.io.IOException

clearIndexKey

void clearIndexKey(java.lang.String keyName)
                   throws java.io.IOException
Clears the entity's index key value for the given key name. This method is called when the entity for this foreign key is deleted, if ON_DELETE_CLEAR was specified when creating the index.

Parameters:
keyName - identifies the index key.
Throws:
java.io.IOException