@Configuration(proxyBeanMethods=false) @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}) @ConditionalOnRepositoryType(store="mongodb", type=IMPERATIVE) @Import(value=org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfigureRegistrar.class) @AutoConfigureAfter(value=MongoDataAutoConfiguration.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 © 2019 Pivotal Software, Inc.. All rights reserved.