@Configuration @ConditionalOnClass(value={, }) @EnableConfigurationProperties(value=MongoProperties.class) public class MongoDataAutoConfiguration extends Object
Auto-configuration
for Spring Data's mongo support.
Registers a MongoTemplate
and GridFsTemplate
beans if no other beans of
the same type are configured.
Honors the spring.data.mongodb.database property if set, otherwise connects to the test database.
Constructor and Description |
---|
MongoDataAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
GridFsTemplate |
gridFsTemplate(MongoDbFactory mongoDbFactory,
MongoTemplate mongoTemplate) |
MappingMongoConverter |
mappingMongoConverter(MongoDbFactory factory,
MongoMappingContext context,
BeanFactory beanFactory) |
MongoDbFactory |
mongoDbFactory(Mongo mongo) |
MongoMappingContext |
mongoMappingContext() |
MongoTemplate |
mongoTemplate(MongoDbFactory mongoDbFactory,
MongoConverter converter) |
@Bean @ConditionalOnMissingBean public MongoDbFactory mongoDbFactory(Mongo mongo) throws Exception
Exception
@Bean @ConditionalOnMissingBean public MongoTemplate mongoTemplate(MongoDbFactory mongoDbFactory, MongoConverter converter) throws UnknownHostException
UnknownHostException
@Bean @ConditionalOnMissingBean(value=) public MappingMongoConverter mappingMongoConverter(MongoDbFactory factory, MongoMappingContext context, BeanFactory beanFactory)
@Bean @ConditionalOnMissingBean public MongoMappingContext mongoMappingContext()
@Bean @ConditionalOnMissingBean public GridFsTemplate gridFsTemplate(MongoDbFactory mongoDbFactory, MongoTemplate mongoTemplate)
Copyright © 2014 Pivotal Software, Inc.. All rights reserved.