Skip to content

spring-multi-data-souce:0.1.2

Latest
Compare
Choose a tag to compare
@Dhi13man Dhi13man released this 06 Oct 11:42
· 4 commits to main since this release
257e580

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.

Release