1

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.

asked Feb 17 at 14:19

1 Answer 1

0

No Spring Data does not support this.

answered Feb 21 at 6:43
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.