|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sleepycat.bdb.factory.TupleSerialDbFactory
Creates stored collections having tuple keys and serialized entity values. The entity classes must implement the java.io.Serializable and MarshalledTupleKeyEntity interfaces. The key classes must either implement the MarshalledTupleData interface or be one of the Java primitive type classes.
This factory object is used to create DataStore, DataIndex, ForeignKeyIndex and Map objects. The underlying DataFormat, DataBinding and KeyExtractor objects are created automatically.
Constructor Summary | |
TupleSerialDbFactory(ClassCatalog catalog)
Creates a tuple-serial factory for given environment and class catalog. |
Method Summary | |
ClassCatalog |
getCatalog()
Returns the class catalog associated with this factory. |
DataIndex |
newDataIndex(DataStore store,
Db db,
String keyName,
boolean usePrimaryKey,
boolean useValue)
Creates an index from a previously opened Db object. |
DataStore |
newDataStore(Db db,
Class baseClass,
PrimaryKeyAssigner keyAssigner)
Creates a store from a previously opened Db object. |
ForeignKeyIndex |
newForeignKeyIndex(DataStore store,
Db db,
String keyName,
boolean usePrimaryKey,
boolean useValue,
DataStore foreignStore,
int deleteAction)
Creates a foreign key index from a previously opened Db object. |
StoredMap |
newMap(DataIndex index,
Class keyClass,
boolean writeAllowed)
Creates a map for a given index that was obtained from this factory. |
StoredMap |
newMap(DataStore store,
Class keyClass,
boolean writeAllowed)
Creates a map for a given store that was obtained from this factory. |
StoredSortedMap |
newSortedMap(DataIndex index,
Class keyClass,
boolean writeAllowed)
Creates a sorted map for a given index that was obtained from this factory. |
StoredSortedMap |
newSortedMap(DataStore store,
Class keyClass,
boolean writeAllowed)
Creates a sorted map for a given store that was obtained from this factory. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TupleSerialDbFactory(ClassCatalog catalog)
Method Detail |
public final ClassCatalog getCatalog()
public DataStore newDataStore(Db db, Class baseClass, PrimaryKeyAssigner keyAssigner)
db
- the previously opened Db object.baseClass
- the base class of the entity values for this store.
It must implement the MarshalledTupleKeyEntity
interface.keyAssigner
- an object for assigning keys or null if no automatic
key assignment is used.public DataIndex newDataIndex(DataStore store, Db db, String keyName, boolean usePrimaryKey, boolean useValue)
db
- the previously opened Db object.store
- the store to be indexed and also specifies the
environment that was used to create the Db object.keyName
- is the key name passed to the MarshalledTupleKeyEntity.marshalIndexKey(java.lang.String, com.sleepycat.bdb.bind.tuple.TupleOutput)
method to identify the index
key.usePrimaryKey
- is true if the primary key data is used to
construct the index key.useValue
- is true if the value data is used to construct the index
key.
IllegalArgumentException
- if a format mismatch is detected
between the index and the store, or if unsorted duplicates were
specified for the index Db.public ForeignKeyIndex newForeignKeyIndex(DataStore store, Db db, String keyName, boolean usePrimaryKey, boolean useValue, DataStore foreignStore, int deleteAction)
store
- the store to be indexed and also specifies the
environment that was used to create the Db object.db
- the previously opened Db object.keyName
- is the key name passed to the MarshalledTupleKeyEntity.marshalIndexKey(java.lang.String, com.sleepycat.bdb.bind.tuple.TupleOutput)
method to identify the index
key.usePrimaryKey
- is true if the primary key data is used to
construct the index key.useValue
- is true if the value data is used to construct the index
key.foreignStore
- is the store in which the index key for this store
is a primary key.deleteAction
- determines what action occurs when the foreign key
is deleted. It must be one of the
ForeignKeyIndex
ON_DELETE_
constants.
IllegalArgumentException
- if a format mismatch is detected
between the index and the store, or if unsorted duplicates were
specified for the index Db.public StoredMap newMap(DataStore store, Class keyClass, boolean writeAllowed)
store
- a store obtained from this factory.keyClass
- is the class used for map keys. It must implement the
MarshalledTupleData
interface or be one of the Java primitive
type classes.writeAllowed
- is true to create a read-write collection or false
to create a read-only collection.public StoredMap newMap(DataIndex index, Class keyClass, boolean writeAllowed)
index
- a index obtained from this factory.keyClass
- is the class used for map keys. It must implement the
MarshalledTupleData
interface or be one of the Java primitive
type classes.writeAllowed
- is true to create a read-write collection or false
to create a read-only collection.public StoredSortedMap newSortedMap(DataStore store, Class keyClass, boolean writeAllowed)
store
- a store obtained from this factory.keyClass
- is the class used for map keys. It must implement the
MarshalledTupleData
interface or be one of the Java primitive
type classes.writeAllowed
- is true to create a read-write collection or false
to create a read-only collection.public StoredSortedMap newSortedMap(DataIndex index, Class keyClass, boolean writeAllowed)
index
- an index obtained from this factory.keyClass
- is the class used for map keys. It must implement the
MarshalledTupleData
interface or be one of the Java primitive
type classes.writeAllowed
- is true to create a read-write collection or false
to create a read-only collection.
|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |