spring-projects / spring-projects/spring-data-jpa

Allow @EntityGraph to be specified at class level [DATAJPA-673]

Open
#1,050 1 comment 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 30, 2020.

in: core type: enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.