@Configuration @ConditionalOnClass(value={com.mongodb.MongoClient.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}) @ConditionalOnProperty(prefix="spring.data.mongodb.repositories", name="enabled", havingValue="true", matchIfMissing=true) @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 © 2018 Pivotal Software, Inc.. All rights reserved.