EntityBinding<E>
TupleSerialMarshalledBinding
public abstract class TupleSerialBinding<D,E> extends TupleBase implements EntityBinding<E>
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 | Description |
---|---|---|
protected SerialBinding<D> |
dataBinding |
Constructor | Description |
---|---|
TupleSerialBinding(ClassCatalog classCatalog,
java.lang.Class<D> baseClass) |
Creates a tuple-serial entity binding.
|
TupleSerialBinding(SerialBinding<D> dataBinding) |
Creates a tuple-serial entity binding.
|
Modifier and Type | Method | Description |
---|---|---|
abstract E |
entryToObject(TupleInput keyInput,
D dataInput) |
Constructs an entity object from
TupleInput key entry and
deserialized data entry objects. |
E |
entryToObject(DatabaseEntry key,
DatabaseEntry data) |
Converts key and data entry buffers into an entity Object.
|
abstract D |
objectToData(E object) |
Extracts a data object from an entity object.
|
void |
objectToData(E object,
DatabaseEntry data) |
Extracts the data entry from an entity Object.
|
abstract void |
objectToKey(E object,
TupleOutput keyOutput) |
Extracts a key tuple from an entity object.
|
void |
objectToKey(E object,
DatabaseEntry key) |
Extracts the key entry from an entity Object.
|
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
protected SerialBinding<D> dataBinding
public TupleSerialBinding(ClassCatalog classCatalog, java.lang.Class<D> 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<D> dataBinding)
dataBinding
- is the data binding.public E entryToObject(DatabaseEntry key, DatabaseEntry data)
EntityBinding
entryToObject
in interface EntityBinding<D>
key
- is the source key entry.data
- is the source data entry.public void objectToKey(E object, DatabaseEntry key)
EntityBinding
objectToKey
in interface EntityBinding<D>
object
- is the source Object.key
- is the destination entry buffer.public void objectToData(E object, DatabaseEntry data)
EntityBinding
objectToData
in interface EntityBinding<D>
object
- is the source Object.data
- is the destination entry buffer.public abstract E entryToObject(TupleInput keyInput, D 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(E object, TupleOutput keyOutput)
object
- is the entity object.keyOutput
- is the TupleOutput
to which the key should be
written.Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.