Class StoreConfig
- All Implemented Interfaces:
Cloneable
EntityStore or RawStore.
StoreConfig objects are thread-safe. Multiple threads may safely
call the methods of a shared StoreConfig object.
See the
invalid @link
{@link <a href="package-summary.html#example">package
StoreConfig.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StoreConfigThe default store configuration containing properties as if the configuration were constructed and not modified. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an entity store configuration object with default properties. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a shallow copy of the configuration.Deprecated.booleanReturns whether creation of a new store is allowed.Returns the object reponsible for naming of files and databases.booleanReturns whether opening an existing store is prohibited.getModel()Returns the entity model that defines entity classes and index keys.Returns the configured mutations for performing lazy evolution of stored instances.booleanReturns the read-only configuration property.booleanReturns the bulk-load-secondaries configuration property.booleanReturns the transactional configuration property.setAllowCreate(boolean allowCreate) Specifies whether creation of a new store is allowed.setDatabaseNamer(DatabaseNamer databaseNamer) Specifies the object reponsible for naming of files and databases.setExclusiveCreate(boolean exclusiveCreate) Specifies whether opening an existing store is prohibited.setModel(EntityModel model) Sets the entity model that defines entity classes and index keys.setMutations(Mutations mutations) Configures mutations for performing lazy evolution of stored instances.setReadOnly(boolean readOnly) Sets the read-only configuration property.setSecondaryBulkLoad(boolean secondaryBulkLoad) Sets the bulk-load-secondaries configuration property.setTransactional(boolean transactional) Sets the transactional configuration property.
-
Field Details
-
DEFAULT
The default store configuration containing properties as if the configuration were constructed and not modified.
-
-
Constructor Details
-
StoreConfig
public StoreConfig()Creates an entity store configuration object with default properties.
-
-
Method Details
-
cloneConfig
Deprecated.As of JE 4.0.13, replaced byclone().Returns a shallow copy of the configuration. -
clone
Returns a shallow copy of the configuration. -
setAllowCreate
Specifies whether creation of a new store is allowed. By default this property is false.If this property is false and the internal store metadata database does not exist,
DatabaseExceptionwill be thrown when the store is opened. -
getAllowCreate
public boolean getAllowCreate()Returns whether creation of a new store is allowed. -
setExclusiveCreate
Specifies whether opening an existing store is prohibited. By default this property is false.If this property is true and the internal store metadata database already exists,
DatabaseExceptionwill be thrown when the store is opened. -
getExclusiveCreate
public boolean getExclusiveCreate()Returns whether opening an existing store is prohibited. -
setTransactional
Sets the transactional configuration property. By default this property is false.This property is true to open all store indices for transactional access. True may not be specified if the environment is not also transactional.
-
getTransactional
public boolean getTransactional()Returns the transactional configuration property. -
setReadOnly
Sets the read-only configuration property. By default this property is false.This property is true to open all store indices for read-only access, or false to open them for read-write access. False may not be specified if the environment is read-only.
-
getReadOnly
public boolean getReadOnly()Returns the read-only configuration property. -
setSecondaryBulkLoad
Sets the bulk-load-secondaries configuration property. By default this property is false.This property is true to cause the initial creation of secondary indices to be performed as a bulk load. If this property is true and
EntityStore.getSecondaryIndexhas never been called for a secondary index, that secondary index will not be created or written as records are written to the primary index. In addition, if that secondary index defines a foreign key constraint, the constraint will not be enforced.The secondary index will be populated later when the
getSecondaryIndexmethod is called for the first time for that index, or when the store is closed and re-opened with this property set to false and the primary index is obtained. In either case, the secondary index is populated by reading through the entire primary index and adding records to the secondary index as needed. While populating the secondary, foreign key constraints will be enforced and an exception is thrown if a constraint is violated.When loading a primary index along with secondary indexes from a large input data set, configuring a bulk load of the secondary indexes is sometimes more performant than updating the secondary indexes each time the primary index is updated. The absence of foreign key constraints during the load also provides more flexibility.
-
getSecondaryBulkLoad
public boolean getSecondaryBulkLoad()Returns the bulk-load-secondaries configuration property. -
setModel
Sets the entity model that defines entity classes and index keys.If null is specified or this method is not called, an
AnnotationModelinstance is used by default. -
getModel
Returns the entity model that defines entity classes and index keys. -
setMutations
Configures mutations for performing lazy evolution of stored instances. Existing mutations for this store are not cleared, so the mutations required are only those changes that have been made since the store was last opened. Some new mutations may override existing specifications, and some may be supplemental.If null is specified and the store already exists, the previously specified mutations are used. The mutations are stored persistently in serialized form.
Mutations must be available to handle all changes to classes that are incompatible with the class definitions known to this store. See
MutationsandClass Evolutionfor more information.If an incompatible class change has been made and mutations are not available for handling the change,
IncompatibleClassExceptionwill be thrown when creating anEntityStore. -
getMutations
Returns the configured mutations for performing lazy evolution of stored instances. -
setDatabaseNamer
Specifies the object reponsible for naming of files and databases. By default this property isDatabaseNamer.DEFAULT.- Throws:
NullPointerException- if a null parameter value is passed.
-
getDatabaseNamer
Returns the object reponsible for naming of files and databases.
-
clone().