Package com.sleepycat.bind.serial
Class TupleSerialMarshalledBinding<E extends MarshalledTupleKeyEntity>
java.lang.Object
com.sleepycat.bind.tuple.TupleBase
com.sleepycat.bind.serial.TupleSerialBinding<E,E>
com.sleepycat.bind.serial.TupleSerialMarshalledBinding<E>
- All Implemented Interfaces:
EntityBinding<E>
public class TupleSerialMarshalledBinding<E extends MarshalledTupleKeyEntity>
extends TupleSerialBinding<E,E>
A concrete
TupleSerialBinding that delegates to the
MarshalledTupleKeyEntity interface of the entity class.
The MarshalledTupleKeyEntity interface must be implemented by the
entity class to convert between the key/data entry and entity object.
The binding is "tricky" in that it uses the entity class for both the stored data entry and the combined entity object. To do this, the entity's key field(s) are transient and are set by the binding after the data object has been deserialized. This avoids the use of a "data" class completely.
- See Also:
-
Field Summary
Fields inherited from class com.sleepycat.bind.serial.TupleSerialBinding
dataBinding -
Constructor Summary
ConstructorsConstructorDescriptionTupleSerialMarshalledBinding(ClassCatalog classCatalog, Class<E> baseClass) Creates a tuple-serial marshalled binding object.TupleSerialMarshalledBinding(SerialBinding<E> dataBinding) Creates a tuple-serial marshalled binding object. -
Method Summary
Modifier and TypeMethodDescriptionentryToObject(TupleInput tupleInput, E javaInput) Constructs an entity object fromTupleInputkey entry and deserialized data entry objects.objectToData(E object) Extracts a data object from an entity object.voidobjectToKey(E object, TupleOutput output) Extracts a key tuple from an entity object.Methods inherited from class com.sleepycat.bind.serial.TupleSerialBinding
entryToObject, objectToData, objectToKeyMethods inherited from class com.sleepycat.bind.tuple.TupleBase
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
-
Constructor Details
-
TupleSerialMarshalledBinding
Creates a tuple-serial marshalled binding object.- Parameters:
classCatalog- is the catalog to hold shared class information and for a database should be aStoredClassCatalog.baseClass- is the base class for serialized objects stored using this binding -- all objects using this binding must be an instance of this class.
-
TupleSerialMarshalledBinding
Creates a tuple-serial marshalled binding object.- Parameters:
dataBinding- is the binding used for serializing and deserializing the entity object.
-
-
Method Details
-
entryToObject
Description copied from class:TupleSerialBindingConstructs an entity object fromTupleInputkey entry and deserialized data entry objects.- Specified by:
entryToObjectin classTupleSerialBinding<E extends MarshalledTupleKeyEntity,E extends MarshalledTupleKeyEntity> - Parameters:
tupleInput- is theTupleInputkey entry object.javaInput- is the deserialized data entry object.- Returns:
- the entity object constructed from the key and data.
-
objectToKey
Description copied from class:TupleSerialBindingExtracts a key tuple from an entity object.- Specified by:
objectToKeyin classTupleSerialBinding<E extends MarshalledTupleKeyEntity,E extends MarshalledTupleKeyEntity> - Parameters:
object- is the entity object.output- is theTupleOutputto which the key should be written.
-
objectToData
Description copied from class:TupleSerialBindingExtracts a data object from an entity object.- Specified by:
objectToDatain classTupleSerialBinding<E extends MarshalledTupleKeyEntity,E extends MarshalledTupleKeyEntity> - Parameters:
object- is the entity object.- Returns:
- the deserialized data object.
-