public class TupleSerialMarshalledBinding<E extends MarshalledTupleKeyEntity> extends TupleSerialBinding<E,E>
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.
MarshalledTupleKeyEntity
,
Class EvolutiondataBinding
Constructor and Description |
---|
TupleSerialMarshalledBinding(ClassCatalog classCatalog,
java.lang.Class<E> baseClass)
Creates a tuple-serial marshalled binding object.
|
TupleSerialMarshalledBinding(SerialBinding<E> dataBinding)
Creates a tuple-serial marshalled binding object.
|
Modifier and Type | Method and Description |
---|---|
E |
entryToObject(TupleInput tupleInput,
E javaInput)
Constructs an entity object from
TupleInput key entry and
deserialized data entry objects. |
E |
objectToData(E object)
Extracts a data object from an entity object.
|
void |
objectToKey(E object,
TupleOutput output)
Extracts a key tuple from an entity object.
|
entryToObject, objectToData, objectToKey
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
public TupleSerialMarshalledBinding(ClassCatalog classCatalog, java.lang.Class<E> baseClass)
classCatalog
- is the catalog to hold shared class information and
for a database should be a StoredClassCatalog
.baseClass
- is the base class for serialized objects stored using
this binding -- all objects using this binding must be an instance of
this class.public TupleSerialMarshalledBinding(SerialBinding<E> dataBinding)
dataBinding
- is the binding used for serializing and deserializing
the entity object.public E entryToObject(TupleInput tupleInput, E javaInput)
TupleSerialBinding
TupleInput
key entry and
deserialized data entry objects.entryToObject
in class TupleSerialBinding<E extends MarshalledTupleKeyEntity,E extends MarshalledTupleKeyEntity>
tupleInput
- is the TupleInput
key entry object.javaInput
- is the deserialized data entry object.public void objectToKey(E object, TupleOutput output)
TupleSerialBinding
objectToKey
in class TupleSerialBinding<E extends MarshalledTupleKeyEntity,E extends MarshalledTupleKeyEntity>
object
- is the entity object.output
- is the TupleOutput
to which the key should be
written.public E objectToData(E object)
TupleSerialBinding
objectToData
in class TupleSerialBinding<E extends MarshalledTupleKeyEntity,E extends MarshalledTupleKeyEntity>
object
- is the entity object.Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.