Dhiman Seal
@EnableJpaRepositories
mapped to one package for each data source.EntityManagerFactoryBuilder
injected, we need to declare one of the data sources and all its beans as @Primary
. Otherwise, the service won't even start up. @EnableJpaRepositories
and @EntityScan
annotations used by Spring.\@EnableMultiDataSourceConfig
. It can not be applied directly anywhere other than in the dataSourceConfigs
attribute of @EnableMultiDataSourceConfig
.target/generated-sources/annotations
directory.implements IMultiDataSourceConfig
from the generated @Configuration
classes.@EnableMultiDataSourceConfig
annotation from your configuration class.@TargetSecondaryDataSource
annotation from your repository methods.spring-multi-data-source
dependency from your project pom.