As a ...
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.
As a ...
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@Fetchor@Fetchingannotation:For implementations based on Jakarta Persistence, this might be backed by construction of an
EntityGraph.