spring-projects / spring-data-relational

Spring Data Relational. Home of Spring Data JDBC and Spring Data R2DBC.
https://spring.io/projects/spring-data-jdbc
Apache License 2.0
771 stars 346 forks source link

Load arbitrary aggregates with a single select #1445

Open schauder opened 1 year ago

schauder commented 1 year ago

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:

devfarzane commented 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.

schauder commented 1 year ago

The implementation started and we hope to make first parts available during 2023.

mhyeon-lee commented 1 year ago

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.

This feature is very useful. I'm looking forward to seeing it nicely addressed in Spring Data JDBC.