How Spring Boot Application Works Internally ?
Spring Boot Application Internal Working.
Spring does not generate any code automatically and not using any xml configuration file . so spring uses internally pragmatically configuration done by spring boot developer that are provided by jar.
we are using just pre-configured jar . and those jar available in:
META-INF/spring.factories
Enable
Disable
To Enable preconfigured jars we just need to define dependency in pom.xml file.
‘<’dependency’>’
‘<’groupId’>’org.springframework.boot’<’/groupId’>’
‘<’artifactId’>’spring-boot-starter-data-jpa’<’/artifactId’>’
‘<’/dependency’>’
This dependency will load all the jars related to JPA repository and stored into spring.factories.
you can go to maven dependencies then click and open spring-boot-autoconfigure jar in the last you will see META-INF folder inside this spring.factories here you will find your jar org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration.
Based on @Conditional and @Configuration :
@Configuration(proxyBeanMethods = false)
@ConditionalOnBean(DataSource.class)
@ConditionalOnClass(JpaRepository.class)
@ConditionalOnMissingBean({ JpaRepositoryFactoryBean.class, JpaRepositoryConfigExtension.class })
@ConditionalOnProperty(prefix = “spring.data.jpa.repositories”…