Add EntityGraphHint query method parameter - #4285
Conversation
3d4594c to
89181cd
Compare
Repository query methods can now accept EntityGraphHint to choose an entity graph per invocation from typed property paths, named entity graphs, or a JPA EntityGraph instance. The hint is treated as a special parameter and applied by runtime and AOT query creation. Closes spring-projects#4175 Signed-off-by: YeongJae Min <whereismysejong@naver.com>
89181cd to
8788976
Compare
|
One precedence case seems worth pinning down with a regression test: if a query method declares The implementation currently does that, while the tests cover the hint-only path and the |
@jewoodev Thanks! I added regression tests for this in both the runtime and AOT paths. The tests invoke a method that declares That should make the intended precedence explicit: non-null |
Add runtime and AOT coverage for query methods that declare @EntityGraph and receive a non-null EntityGraphHint, verifying that the invocation-level hint takes precedence over the declared graph. Related spring-projects#4175 Signed-off-by: YeongJae Min <whereismysejong@naver.com>
523621a to
1de59ae
Compare
Keep the existing named-graph null fallback fixture intact and add a separate explicit attribute-path method for the override test, so the override assertion does not depend on the contents of a named graph. Related spring-projects#4175 Signed-off-by: YeongJae Min <whereismysejong@naver.com>
1de59ae to
c33c53e
Compare
4887543 to
c43320e
Compare
Repository query methods can now accept
EntityGraphHintto select an entity graph per invocation.The hint can be created from type-safe property paths, named entity graphs, or a JPA
EntityGraphinstance. We treat the hint as a special parameter so it is excluded from query binding and apply it for runtime and AOT query creation. If the argument isnull, query creation falls back to the declared@EntityGraphmetadata.Includes unit and integration tests for parameter discovery, runtime query creation, repository execution, and AOT query generation.
Closes #4175