@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Inherited @Import(value=MongoSyncDatastoreRegistrar.class) @EnableDatastoreConfiguration public @interface EnableMongoDatastore
Datastore.| Modifier and Type | Fields and Description |
|---|---|
static String |
DEFAULT_DATASTORE_BEAN_NAME
Default Datastore registration bean name.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String |
database
Get the database name to use.
|
String |
dataContextId
Optional data context id to use to discriminate Datastores when more than one persistence source is configured,
i.e.
|
EnumCodecStrategy |
enumCodecStrategy
The default
EnumCodecStrategy to use when encoding and decoding enum type values. |
String |
mongoClientReference
Configures the name of the
MongoClient bean definition to be used to create the Datastore
registered using this annotation. |
com.holonplatform.spring.PrimaryMode |
primary
Whether to qualify
Datastore bean as primary, i.e. |
MongoReadConcern |
readConcern
Get the default
ReadConcern for the read operations isolation level. |
MongoReadPreference |
readPreference
Get the default
ReadPreference for query or data read operations. |
MongoWriteConcern |
writeConcern
Get the default
WriteConcern for write operations acknowledgment. |
public static final String DEFAULT_DATASTORE_BEAN_NAME
public abstract String dataContextId
MongoClient beans are configured in context.
The configured data context id will be returned by the DataContextBound.getDataContextId() method of the
registered Datastore.
When a data context id is specified, the registered Datastore is bound to the MongoClient with a
matching data context id, if available. During registration phase, if the data context id is not null/empty and a
mongoClientReference() is not specified, a MongoClient bean is searched in context using
the bean name pattern: mongoClient_[datacontextid] where [datacontextid] is equal to
dataContextId() attribute.
public abstract String mongoClientReference
MongoClient bean definition to be used to create the Datastore
registered using this annotation. See dataContextId() for informations about MongoClient
bean lookup when a specific name is not configured.
By default, the MongoDatastoreConfigProperties.DEFAULT_MONGO_CLIENT_BEAN_NAME bean name is used.
MongoClient bean definition to be used to create the Datastorepublic abstract String database
public abstract com.holonplatform.spring.PrimaryMode primary
Datastore bean as primary, i.e. the preferential bean to be injected in a
single-valued dependency when multiple candidates are present.
When mode is PrimaryMode.AUTO, the registred Datastore bean is marked as primary only when the
MongoClient bean to which is bound is registered as primary bean.
PrimaryMode.AUTOpublic abstract MongoReadPreference readPreference
ReadPreference for query or data read operations.ReadPreference using the MongoReadPreference enumerationpublic abstract MongoReadConcern readConcern
ReadConcern for the read operations isolation level.ReadConcern using the MongoReadConcern enumerationpublic abstract MongoWriteConcern writeConcern
WriteConcern for write operations acknowledgment.WriteConcern using the MongoWriteConcern enumerationpublic abstract EnumCodecStrategy enumCodecStrategy
EnumCodecStrategy to use when encoding and decoding enum type values.EnumCodecStrategy, defaults to EnumCodecStrategy.NAMECopyright © 2019 The Holon Platform. All rights reserved.