Package com.sleepycat.collections
Class TupleSerialFactory
java.lang.Object
com.sleepycat.collections.TupleSerialFactory
Creates stored collections having tuple keys and serialized entity values.
The entity classes must be Serializable and must implement the
MarshalledTupleKeyEntity interfaces. The key classes must either implement
the MarshalledTupleEntry interface or be one of the Java primitive type
classes. Underlying binding objects are created automatically.
-
Constructor Summary
ConstructorsConstructorDescriptionTupleSerialFactory(ClassCatalog catalog) Creates a tuple-serial factory for given environment and class catalog. -
Method Summary
Modifier and TypeMethodDescriptionfinal ClassCatalogReturns the class catalog associated with this factory.<V extends MarshalledTupleKeyEntity>
TupleSerialMarshalledBinding<V> getEntityBinding(Class<V> baseClass) <V extends MarshalledTupleKeyEntity>
TupleSerialMarshalledKeyCreator<V> getKeyCreator(Class<V> valueBaseClass, String keyName) Creates aSecondaryKeyCreatorobject for use in configuring aSecondaryDatabase.<K,V extends MarshalledTupleKeyEntity>
StoredMap<K, V> Creates a map from a previously opened Database object.<K,V extends MarshalledTupleKeyEntity>
StoredSortedMap<K, V> newSortedMap(Database db, Class<K> keyClass, Class<V> valueBaseClass, boolean writeAllowed) Creates a sorted map from a previously opened Database object.
-
Constructor Details
-
TupleSerialFactory
Creates a tuple-serial factory for given environment and class catalog.
-
-
Method Details
-
getCatalog
Returns the class catalog associated with this factory. -
newMap
public <K,V extends MarshalledTupleKeyEntity> StoredMap<K,V> newMap(Database db, Class<K> keyClass, Class<V> valueBaseClass, boolean writeAllowed) Creates a map from a previously opened Database object.- Parameters:
db- the previously opened Database object.keyClass- is the class used for map keys. It must implement theMarshalledTupleEntryinterface or be one of the Java primitive type classes.valueBaseClass- the base class of the entity values for this store. It must implement theMarshalledTupleKeyEntityinterface.writeAllowed- is true to create a read-write collection or false to create a read-only collection.
-
newSortedMap
public <K,V extends MarshalledTupleKeyEntity> StoredSortedMap<K,V> newSortedMap(Database db, Class<K> keyClass, Class<V> valueBaseClass, boolean writeAllowed) Creates a sorted map from a previously opened Database object.- Parameters:
db- the previously opened Database object.keyClass- is the class used for map keys. It must implement theMarshalledTupleEntryinterface or be one of the Java primitive type classes.valueBaseClass- the base class of the entity values for this store. It must implement theMarshalledTupleKeyEntityinterface.writeAllowed- is true to create a read-write collection or false to create a read-only collection.
-
getKeyCreator
public <V extends MarshalledTupleKeyEntity> TupleSerialMarshalledKeyCreator<V> getKeyCreator(Class<V> valueBaseClass, String keyName) Creates aSecondaryKeyCreatorobject for use in configuring aSecondaryDatabase. The returned object implements theSecondaryKeyCreatorinterface.- Parameters:
valueBaseClass- the base class of the entity values for this store. It must implement theMarshalledTupleKeyEntityinterface.keyName- is the key name passed to theMarshalledTupleKeyEntity.marshalSecondaryKey(java.lang.String, com.sleepycat.bind.tuple.TupleOutput)method to identify the secondary key.
-
getEntityBinding
public <V extends MarshalledTupleKeyEntity> TupleSerialMarshalledBinding<V> getEntityBinding(Class<V> baseClass)
-