spring-data-examples
spring-data-examples copied to clipboard
Add Spring Data JDBC How To for Multiple DataSources
- [x] You have read the Spring Data contribution guidelines.
- [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
- [x] You submit test cases (unit or integration tests) that back your changes.
- [x] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
At the moment, Spring Data JDBC isn't ready for prime time with multiple data sources. The repository setup starts breaking apart once using relations (e.g. List<ComplexType>) because the factory bean is being wired without a DataAccessStrategy (also RelationResolver) and the MappingJdbcConverter. We need to fix https://github.com/spring-projects/spring-data-relational/pull/1704 first which introduces consistent configuration through JdbcAggregateOperations for proper routing of entities into the correct data source.