Berkeley DB Java Edition version 3.2.13

## com.sleepycat.persist
Class StoreConfig

    java.lang.Object
      com.sleepycat.persist.StoreConfig

All Implemented Interfaces:
  Cloneable

    public class StoreConfig

extends Object
implements Cloneable

Configuration properties used with an `EntityStore` or `RawStore`.

`StoreConfig` objects are thread-safe. Multiple threads may safely call the methods of a shared `StoreConfig` object.

See the package summary example for an example of using a `StoreConfig`.

Author:
  Mark Hayes

Field Summary
`static StoreConfig` `DEFAULT` The default store configuration containing properties as if the configuration were constructed and not modified.

Constructor Summary
`StoreConfig()` Creates an entity store configuration object with default properties.

Method Summary
`StoreConfig` `cloneConfig()` Returns a shallow copy of the configuration.
`boolean` `getAllowCreate()` Returns whether creation of a new store is allowed.
`boolean` `getDeferredWrite()` Returns the deferred-write configuration property.
`boolean` `getExclusiveCreate()` Returns whether opening an existing store is prohibited.
`EntityModel` `getModel()` Returns the entity model that defines entity classes and index keys.
`Mutations` `getMutations()` Returns the configured mutations for performing lazy evolution of stored instances.
`boolean` `getReadOnly()` Returns the read-only configuration property.
`boolean` `getTransactional()` Returns the transactional configuration property.
`void` `setAllowCreate(boolean allowCreate)` Specifies whether creation of a new store is allowed.
`void` `setDeferredWrite(boolean deferredWrite)` Sets the deferred-write configuration property.
`void` `setExclusiveCreate(boolean exclusiveCreate)` Specifies whether opening an existing store is prohibited.
`void` `setModel(EntityModel model)` Sets the entity model that defines entity classes and index keys.
`void` `setMutations(Mutations mutations)` Configures mutations for performing lazy evolution of stored instances.
`void` `setReadOnly(boolean readOnly)` Sets the read-only configuration property.
`void` `setTransactional(boolean transactional)` Sets the transactional configuration property.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT

    public static final StoreConfig DEFAULT

  The default store configuration containing properties as if the configuration were constructed and not modified.

Constructor Detail

### StoreConfig

    public StoreConfig()

  Creates an entity store configuration object with default properties.

Method Detail

### cloneConfig

    public StoreConfig cloneConfig()

  Returns a shallow copy of the configuration.

### setAllowCreate

    public void setAllowCreate(boolean allowCreate)

  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, `DatabaseNotFoundException` will be thrown when the store is opened.

### getAllowCreate

    public boolean getAllowCreate()

  Returns whether creation of a new store is allowed.

### setExclusiveCreate

    public void setExclusiveCreate(boolean exclusiveCreate)

  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, `DatabaseException` will be thrown when the store is opened.

### getExclusiveCreate

    public boolean getExclusiveCreate()

  Returns whether opening an existing store is prohibited.

### setTransactional

    public void setTransactional(boolean transactional)

  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

    public void setReadOnly(boolean readOnly)

  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.

### setDeferredWrite

    public void setDeferredWrite(boolean deferredWrite)

  Sets the deferred-write configuration property. By default this property is false.

  This property is true to open all store index databases for deferred-write access. True may not be specified if the store is transactional.

  Deferred write stores avoid disk I/O and are not guaranteed to be persistent until `EntityStore.sync()` or `Environment.sync()` is called. This mode is particularly geared toward temporary stores, or stores that frequently modify and delete data records. See the Getting Started Guide, Database chapter for a full description of the mode.

  See Also:
    `setTransactional(boolean)`

### getDeferredWrite

    public boolean getDeferredWrite()

  Returns the deferred-write configuration property.

### setModel

    public void setModel(EntityModel model)

  Sets the entity model that defines entity classes and index keys.

  If null is specified or this method is not called, an `AnnotationModel` instance is used by default.

### getModel

    public EntityModel getModel()

  Returns the entity model that defines entity classes and index keys.

### setMutations

    public void setMutations(Mutations mutations)

  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 `Mutations` and `Class Evolution` for more information.

  If an incompatible class change has been made and mutations are not available for handling the change, `IncompatibleClassException` will be thrown when creating an `EntityStore`.

### getMutations

    public Mutations getMutations()

  Returns the configured mutations for performing lazy evolution of stored instances.

Berkeley DB Java Edition version 3.2.13

Copyright 1996,2006 Oracle. All rights reserved.