Skip to content

[Use Case]: FetchingΒ #1185

@gavinking

Description

@gavinking

As a ...

  • Application user/user of the configuration itself
  • API user (application developer)
  • SPI user (container or runtime developer)
  • Specification implementer

I need to be able to ...

... specify that certain fields of an entity should be fetched by a repository method.

Which enables me to ...

... control the number of queries executed against the datastore and the amount of data which is fetched.

Additional information

By analogy with @OrderBy, I propose a @Fetch or @Fetching annotation:

@Find 
@Fetching(_Book.AUTHORS)
@Fetching(_Book.PUBLISHER)
Book bookWithAuthors(String isbn);

For implementations based on Jakarta Persistence, this might be backed by construction of an EntityGraph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions