@Configuration @ConditionalOnClass(value={, }) @ConditionalOnBean(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(Mongo mongo,
MongoTemplate mongoTemplate) |
MongoDbFactory |
mongoDbFactory(Mongo mongo) |
MongoTemplate |
mongoTemplate(MongoDbFactory mongoDbFactory) |
@Bean @ConditionalOnMissingBean public MongoDbFactory mongoDbFactory(Mongo mongo) throws Exception
Exception
@Bean @ConditionalOnMissingBean public MongoTemplate mongoTemplate(MongoDbFactory mongoDbFactory) throws UnknownHostException
UnknownHostException
@Bean @ConditionalOnMissingBean public GridFsTemplate gridFsTemplate(Mongo mongo, MongoTemplate mongoTemplate)
Copyright © 2014 Pivotal Software, Inc.. All rights reserved.