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.MongoClient |
mongo |
|
protected java.lang.String |
mongoBeanName |
|
protected com.mongodb.MongoClientOptions |
mongoOptions |
|
protected java.lang.String |
mongoOptionsBeanName |
| Fields inherited from class | Fields |
|---|---|
class AbstractDatastoreInitializer |
ENTITY_CLASS_RESOURCE_PATTERN, OSIV_CLASS_NAME, TRANSACTION_MANAGER_BEAN, classLoader, secondaryDatastore |
| 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.MongoClient mongoClient)Sets a pre-existing Mongo instance to configure for |
|
void |
setMongoOptions(com.mongodb.MongoClientOptions mongoOptions)Sets the MongoOptions instance to use when constructing the Mongo instance |
|
void |
setMongoOptionsBeanName(java.lang.String mongoOptionsBeanName)The name of the MongoOptions bean |
| Methods inherited from class | Name |
|---|---|
class AbstractDatastoreInitializer |
collectMappedClasses, configure, configureForBeanDefinitionRegistry, containsRegisteredBean, findEventPublisher, findMessageSource, getAdditionalBeansConfiguration, getBeanDefinitions, getCommonConfiguration, getGrailsApplicationClass, getGrailsValidatorClass, getPersistenceInterceptorClass, isGrailsPresent, isMappedClass, scanForPersistentClasses, setResourceLoader, setSecondaryDatastore |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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