Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.6.21
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.bind.tuple
Interface MarshalledTupleKeyEntity

    public interface MarshalledTupleKeyEntity

A marshalling interface implemented by entity classes that represent keys as tuples. Since `MarshalledTupleKeyEntity` objects are instantiated using Java deserialization, no particular constructor is required by classes that implement this interface.

Note that a marshalled tuple key extractor is somewhat less efficient than a non-marshalled key tuple extractor because more conversions are needed. A marshalled key extractor must convert the entry to an object in order to extract the key fields, while an unmarshalled key extractor does not.

See Also:
  `TupleTupleMarshalledBinding`, `TupleSerialMarshalledBinding`

Method Summary
`void` | `marshalPrimaryKey(TupleOutput keyOutput)` Extracts the entity's primary key and writes it to the key output.
`boolean` | `marshalSecondaryKey(String keyName, TupleOutput keyOutput)` Extracts the entity's secondary key and writes it to the key output.
`boolean` | `nullifyForeignKey(String keyName)` Clears the entity's secondary key fields for the given key name.
`void` | `unmarshalPrimaryKey(TupleInput keyInput)` Completes construction of the entity by setting its primary key from the stored primary key.

Method Detail

### marshalPrimaryKey

    void marshalPrimaryKey(TupleOutput keyOutput)

  Extracts the entity's primary key and writes it to the key output.

  Parameters:
    `keyOutput` - is the output tuple.

### unmarshalPrimaryKey

    void unmarshalPrimaryKey(TupleInput keyInput)

  Completes construction of the entity by setting its primary key from the stored primary key.

  Parameters:
    `keyInput` - is the input tuple.

### marshalSecondaryKey

    boolean marshalSecondaryKey(String keyName,
                                TupleOutput keyOutput)

  Extracts the entity's secondary key and writes it to the key output.

  Parameters:
    `keyName` - identifies the secondary key.
    `keyOutput` - is the output tuple.
  Returns:
    true if a key was created, or false to indicate that the key is not present.

### nullifyForeignKey

    boolean nullifyForeignKey(String keyName)

  Clears the entity's secondary key fields for the given key name.

  The specified index key should be changed by this method such that `marshalSecondaryKey(java.lang.String, com.sleepycat.bind.tuple.TupleOutput)` for the same key name will return false. Other fields in the data object should remain unchanged.

  Parameters:
    `keyName` - identifies the secondary key.
  Returns:
    true if the key was cleared, or false to indicate that the key is not present and no change is necessary.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.6.21
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996,2007 Oracle. All rights reserved.