@Configuration(proxyBeanMethods=false) @ConditionalOnBean(value=javax.sql.DataSource.class) @ConditionalOnClass(value=org.springframework.data.jpa.repository.JpaRepository.class) @ConditionalOnMissingBean(value={org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.class,org.springframework.data.jpa.repository.config.JpaRepositoryConfigExtension.class}) @ConditionalOnProperty(prefix="spring.data.jpa.repositories", name="enabled", havingValue="true", matchIfMissing=true) @Import(value=org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesRegistrar.class) @AutoConfigureAfter(value={HibernateJpaAutoConfiguration.class,TaskExecutionAutoConfiguration.class}) public class JpaRepositoriesAutoConfiguration extends Object
Auto-configuration
for Spring Data's JPA Repositories.
Activates when there is a bean of type DataSource
configured in the
context, the Spring Data JPA
JpaRepository
type is on the classpath,
and there is no other, existing
JpaRepository
configured.
Once in effect, the auto-configuration is the equivalent of enabling JPA repositories
using the @EnableJpaRepositories
annotation.
This configuration class will activate after the Hibernate auto-configuration.
EnableJpaRepositories
Constructor and Description |
---|
JpaRepositoriesAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
EntityManagerFactoryBuilderCustomizer |
entityManagerFactoryBootstrapExecutorCustomizer(Map<String,AsyncTaskExecutor> taskExecutors) |
@Bean @Conditional(value=org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration.BootstrapExecutorCondition.class) public EntityManagerFactoryBuilderCustomizer entityManagerFactoryBootstrapExecutorCustomizer(Map<String,AsyncTaskExecutor> taskExecutors)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.