public class TupleTupleMarshalledKeyCreator<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity> extends TupleTupleKeyCreator<E>
TupleTupleMarshalledBinding
. This key creator works by calling the
methods of the MarshalledTupleKeyEntity
interface to create and
clear the index key.
Note that a marshalled tuple key creator is somewhat less efficient than a non-marshalled key tuple creator because more conversions are needed. A marshalled key creator must convert the entry to an object in order to create the key, while an unmarshalled key creator does not.
Constructor and Description |
---|
TupleTupleMarshalledKeyCreator(TupleTupleMarshalledBinding<E> binding,
java.lang.String keyName)
Creates a tuple-tuple marshalled key creator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
createSecondaryKey(TupleInput primaryKeyInput,
TupleInput dataInput,
TupleOutput indexKeyOutput)
Creates the index key from primary key tuple and data tuple.
|
boolean |
nullifyForeignKey(TupleInput dataInput,
TupleOutput dataOutput)
Clears the index key in the tuple data entry.
|
createSecondaryKey, nullifyForeignKey
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
public TupleTupleMarshalledKeyCreator(TupleTupleMarshalledBinding<E> binding, java.lang.String keyName)
binding
- is the binding used for the tuple-tuple entity.keyName
- is the key name passed to the MarshalledTupleKeyEntity.marshalSecondaryKey(java.lang.String, com.sleepycat.bind.tuple.TupleOutput)
method to identify the
index key.public boolean createSecondaryKey(TupleInput primaryKeyInput, TupleInput dataInput, TupleOutput indexKeyOutput)
TupleTupleKeyCreator
createSecondaryKey
in class TupleTupleKeyCreator<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
primaryKeyInput
- is the TupleInput
for the primary key
entry.dataInput
- is the TupleInput
for the data entry.indexKeyOutput
- is the destination index key tuple.public boolean nullifyForeignKey(TupleInput dataInput, TupleOutput dataOutput)
TupleTupleKeyCreator
The secondary key should be output or removed by this method such
that TupleTupleKeyCreator.createSecondaryKey(com.sleepycat.je.SecondaryDatabase, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry)
will return false. Other fields in the
data object should remain unchanged.
nullifyForeignKey
in class TupleTupleKeyCreator<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
dataInput
- is the TupleInput
for the data entry.dataOutput
- is the destination TupleOutput
.Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.