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

Consider EntityGraph argument for query methods

Open
#4,175 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
3.3k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

It would be neat to provide an entity graph to a query method through a Spring Data JPA type allowing:

  • Declaration through typed property paths (e.g. EntityGraphHint.fetch(Person::getFirstName, Person::getAddress, …))
  • From a named entity graph reference (EntityGraphHint.fetch("my-named-graph"), EntityGraphHint.load("my-named-graph"))
  • From a EntityGraph object (EntityGraphHint.fetch(obj), EntityGraphHint.load(obj))

Within this ticket, we should also consider the following changes:

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.

Research direction

No implementation files or tests are named. Start by reviewing the proposed EntityGraphHint forms in this issue and then read related issues #2113, #1746, and #1334 to determine the combined scope. Done means the query-method API supports the agreed entity-graph inputs and the related changes have been considered.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.