public abstract class TupleSerialBinding extends TupleBase implements EntityBinding
EntityBinding
that treats an entity's key entry as
a tuple and its data entry as a serialized object.
This class takes care of serializing and deserializing the data entry,
and converting the key entry to/from TupleInput
and TupleOutput
objects. Its three abstract methods must be implemented by a
concrete subclass to convert these objects to/from an entity object.
Modifier and Type | Field and Description |
---|---|
protected SerialBinding |
dataBinding |
Constructor and Description |
---|
TupleSerialBinding(ClassCatalog classCatalog,
java.lang.Class baseClass)
Creates a tuple-serial entity binding.
|
TupleSerialBinding(SerialBinding dataBinding)
Creates a tuple-serial entity binding.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
entryToObject(DatabaseEntry key,
DatabaseEntry data)
Converts key and data entry buffers into an entity Object.
|
abstract java.lang.Object |
entryToObject(TupleInput keyInput,
java.lang.Object dataInput)
Constructs an entity object from
TupleInput key entry and
deserialized data entry objects. |
abstract java.lang.Object |
objectToData(java.lang.Object object)
Extracts a data object from an entity object.
|
void |
objectToData(java.lang.Object object,
DatabaseEntry data)
Extracts the data entry from an entity Object.
|
void |
objectToKey(java.lang.Object object,
DatabaseEntry key)
Extracts the key entry from an entity Object.
|
abstract void |
objectToKey(java.lang.Object object,
TupleOutput keyOutput)
Extracts a key tuple from an entity object.
|
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
protected SerialBinding dataBinding
public TupleSerialBinding(ClassCatalog classCatalog, java.lang.Class baseClass)
classCatalog
- is the catalog to hold shared class information and
for a database should be a StoredClassCatalog
.baseClass
- is the base class.public TupleSerialBinding(SerialBinding dataBinding)
dataBinding
- is the data binding.public java.lang.Object entryToObject(DatabaseEntry key, DatabaseEntry data)
EntityBinding
entryToObject
in interface EntityBinding
key
- is the source key entry.data
- is the source data entry.public void objectToKey(java.lang.Object object, DatabaseEntry key)
EntityBinding
objectToKey
in interface EntityBinding
object
- is the source Object.key
- is the destination entry buffer.public void objectToData(java.lang.Object object, DatabaseEntry data)
EntityBinding
objectToData
in interface EntityBinding
object
- is the source Object.data
- is the destination entry buffer.public abstract java.lang.Object entryToObject(TupleInput keyInput, java.lang.Object dataInput)
TupleInput
key entry and
deserialized data entry objects.keyInput
- is the TupleInput
key entry object.dataInput
- is the deserialized data entry object.public abstract void objectToKey(java.lang.Object object, TupleOutput keyOutput)
object
- is the entity object.keyOutput
- is the TupleOutput
to which the key should be
written.public abstract java.lang.Object objectToData(java.lang.Object object)
object
- is the entity object.