@Configuration @ConditionalOnClass(value={com.mongodb.Mongo.class,org.springframework.data.mongodb.repository.MongoRepository.class}) @ConditionalOnMissingBean(value={org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean.class,org.springframework.data.mongodb.repository.config.MongoRepositoryConfigurationExtension.class}) @Import(value=org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfigureRegistrar.class) public class MongoRepositoriesAutoConfiguration extends Object
Auto-configuration
for Spring Data's Mongo
Repositories.
Activates when there is no bean of type
MongoRepositoryFactoryBean
configured in the context, the Spring Data Mongo
MongoRepository
type is on the
classpath, the Mongo client driver API is on the classpath, and there is no other
configured MongoRepository
.
Once in effect, the auto-configuration is the equivalent of enabling Mongo repositories
using the
EnableMongoRepositories
annotation.
EnableMongoRepositories
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.