@groovy.transform.InheritConstructors class MongoDbDataStoreSpringInitializer extends AbstractDatastoreInitializer
Used to initialize GORM for MongoDB outside of Grails
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
DATASTORE_TYPE |
|
static java.lang.String |
DEFAULT_DATABASE_NAME |
|
protected java.lang.String |
databaseName |
|
protected groovy.lang.Closure |
defaultMapping |
|
protected com.mongodb.client.MongoClient |
mongo |
|
protected java.lang.String |
mongoBeanName |
|
protected com.mongodb.MongoClientSettings |
mongoOptions |
|
protected java.lang.String |
mongoOptionsBeanName |
Fields inherited from class | Fields |
---|---|
class AbstractDatastoreInitializer |
ENTITY_CLASS_RESOURCE_PATTERN, OSIV_CLASS_NAME, TRANSACTION_MANAGER_BEAN, classLoader, configuration, originalConfiguration, packages, persistentClasses, registerApplicationIfNotPresent, resourcePatternResolver, secondaryDatastore |
Constructor and description |
---|
MongoDbDataStoreSpringInitializer
() |
Type Params | Return Type | Name and description |
---|---|---|
|
org.springframework.context.ApplicationContext |
configure() Configures for an existing Mongo instance |
|
groovy.lang.Closure |
getBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionRegistry beanDefinitionRegistry) |
|
protected java.lang.Class<AbstractDatastorePersistenceContextInterceptor> |
getPersistenceInterceptorClass() |
|
protected boolean |
isMappedClass(java.lang.String datastoreType, java.lang.Class cls) |
|
void |
setDatabaseName(java.lang.String databaseName) Sets the name of the MongoDB database to use |
|
void |
setDefaultMapping(groovy.lang.Closure defaultMapping) Sets the default MongoDB GORM mapping configuration |
|
void |
setMongoBeanName(java.lang.String mongoBeanName) Sets the name of the Mongo bean to use |
|
void |
setMongoClient(com.mongodb.client.MongoClient mongoClient) Sets a pre-existing Mongo instance to configure for |
|
void |
setMongoOptions(com.mongodb.MongoClientSettings mongoOptions) Sets the MongoOptions instance to use when constructing the Mongo instance |
|
void |
setMongoOptionsBeanName(java.lang.String mongoOptionsBeanName) The name of the MongoOptions bean |
Configures for an existing Mongo instance
mongo
- The instance of MongoSets the name of the MongoDB database to use
Sets the default MongoDB GORM mapping configuration
Sets the name of the Mongo bean to use
Sets a pre-existing Mongo instance to configure for
mongoClient
- The Mongo instanceSets the MongoOptions instance to use when constructing the Mongo instance
The name of the MongoOptions bean
mongoOptionsBeanName
- The mongo options bean name