Implicit join on one-to-many relations #1330
Labels
in: jdbc
Spring Data JDBC
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
I really like the simplicity of spring-data-jdbc, but the default behaviour somehow breaks my understanding of efficient loading.
Problem description
Having one-to-many relations in an aggregate root always causes N+1 queries. There is no way to change this so if I have the following structure, I end up with many redundant SQL statements.
Minion
Toy
Expected behaviour
Change the default behaviour and load all the relations with implicit join. I assume that the library has the information
Environment
org.springframework.boot:spring-boot-starter:2.5.6
org.springframework.boot:spring-boot-starter-data-jdbc: 2.5.6
org.springframework.data:spring-data-jdbc:2.2.6
The text was updated successfully, but these errors were encountered: