spring-multi-data-souce | v0.1.2
Spring Boot has multiple limitations when using multiple data sources in a single service. This project aims to solve those limitations by providing custom annotations that can be used to generate the required Bean-providing configuration classes and repositories during the build process itself, which the service can then use.
The best part is that the entirety of the generated code is clean, human-readable, and can be directly carried over to the relevant packages of the main code if you no longer wish to be tied down to this library in the future.
Changelog
- HOTFIX: Fix
@EnableJpaRepositories.basePackages
being empty for secondary data sources when@EnableMultiDataSourceConfig.generatedRepositoryPackagePrefix
is not set. Instead, it will be set to the package of the@EnableMultiDataSourceConfig
annotated class followed by.generated.repositories
and then the snake-cased datasource name. - Default
@EnableMultiDataSourceConfig.generatedConfigPackage
changed to the package of the@EnableMultiDataSourceConfig
annotated class followed by.generated.config
instead of@EnableMultiDataSourceConfig.generatedRepositoryPackagePrefix
followed by.config
. - No repositories will be scanned for data sources which do not have a
@TargetDataSource
. - Refactor internal logic for more readability.