spring-projects / spring-projects/spring-data-jpa
Allow @EntityGraph to be specified at class level [DATAJPA-673]
@odrotbohm is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 3.3k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
Eric Sirianni opened DATAJPA-673 and commented
It would be nice if a default @EntityGraph for all queries in a repository class could be specified at the class level. The semantics would be that method-level @EntityGraph annotations would override the class-level default. Perhaps an @EntityGraph(null) could be specified at a method-level to disable entity graph for that query (if "unsetting" the default is needed).
Among other benefits, this would reduce the boilerplate needed to workaround quirks in the JPA implementations (Hibernate) with regards to join-fetching of associations (see DATAJPA-208 and DATAJPA-198)
Affects: 1.7.2 (Evans SR2)
2 votes, 3 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.