spring-projects / spring-projects/spring-data-rest

RepositoryResourceMapping Should Work With Repositories Instead Of PersistentEntities

Open
#2,276 3 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Jul 3, 2023.

status: feedback-provided
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

Hello,

up until version 3.3.9 the RepositoryResourceMappings class was using the Repositories object to populate the cache needed for the ResourceMetadataHandlerMethodArgumentResolver as you can see here:

https://github.com/spring-projects/spring-data-rest/blob/3.3.9.RELEASE/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryResourceMappings.java#L69

Then this method was changed to use the PersistentEntities as youc an see here:

https://github.com/spring-projects/spring-data-rest/blob/main/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/mapping/RepositoryResourceMappings.java#L69

The PersistentEntities object is constructed by trying to locate all the javax.persistence.metamodel.Metamodel and thus completely ignores the alternativeDomainTypes a RepositoryMetadata may hold.

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.