I am using Spring Data JDBC repositories which are defined through interfaces (which extend Repository<Entity, Id> and have their queries specified through @Query) for various entities and everything works well.
For reporting purpose, I would like to make queries which span multiples types of root-aggregates/entities. I don't want to put those queries in any of those entities' repository. I'd like to have some kind of separate repository (for reporting only) which:
- does not need to be associated to an entity in particular (and so, does not extend
Repository<Entity, Id>) - has its queries specified through
@Query - uses custom type converters which are already registered for Spring Data
- returns only DTOs (no entities) from projections in the queries
Does Spring Data (or any other Spring module) provide such a feature? I know I can implement that kind of repository myself using JdbcTemplate/JdbcClient but I was wondering if Spring provided automatically-generated proxies for such operations like it does for HTTP with HttpServiceProxyFactory.
1 Answer 1
No Spring Data does not support this.