Open schauder opened 1 year ago
Hi, thanks for this enhancement. I just wanted to know is there any plans for this feature? Like when implementation process is going to start and in which spring version we can use it? I'm specifically interested in single queries using R2DBC.
The implementation started and we hope to make first parts available during 2023.
I'm very excited to see that Spring Data JDBC is addressing this issue I solved the problem in the same way as presented in this blog post and published the code. (Single Query and Aggregate ResultSet Mapping) This is the Beginning of the End of the N+1 Problem: Introducing Single Query Loading.
Spring JDBC Plus is a library that extends Spring JDBC and Spring Data JDBC.
AggregateResultSetExtractor : https://github.com/naver/spring-jdbc-plus/blob/7ad384bc3d50ac66e3d06405973044ec0267a174/spring-data-jdbc-plus-sql/src/main/java/com/navercorp/spring/data/jdbc/plus/sql/convert/AggregateResultSetExtractor.java#L34
AggregateResultJdbcConverter : Map results from a ResultSet to entities, grouped by the value of the @Id column https://github.com/naver/spring-jdbc-plus/blob/7ad384bc3d50ac66e3d06405973044ec0267a174/spring-data-jdbc-plus-sql/src/main/java/com/navercorp/spring/data/jdbc/plus/sql/convert/AggregateResultJdbcConverter.java#L66
https://github.com/naver/spring-jdbc-plus/wiki/User-Guide#142-aggregateresultsetextractor
This feature is very useful. I'm looking forward to seeing it nicely addressed in Spring Data JDBC.
This should resolve #592. I opted for a separate issue in order to allow for a more focused discourse about this specific approach.
We have a concept for how to load arbitrary aggregates with a single select statement, at least for those databases that support a sufficient subset of the SQL standard.
This ticket is an epic for tracking the progress in the implementation this concept.
Subtickets: