spring-projects / spring-projects/spring-data-rest
Customize UserDomainType to CRUDRepository Mapping [DATAREST-472]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Brad lee opened DATAREST-472 and commented
Sorry ahead of time if this request exists in some other fashion, I could not find it.
The current code (org.springframework.data.repository.support.Repositories.java) searches for any CRUDRepository and uses a map to configure which one to use against the given UserDomainType (ie, the model class - JPA in my case). The code uses a "last one wins" approach, and as a result I could not find any way to customize it to use a specific CRUD Repository. Additionally, the Repositories.java class is written in such a way as to discourage extension, using private arg-based constructors with no access to local private variables.
I've attached a newer Repositories.java class which I based on the original to maintain the original functionality and also allow a user to configure regular expression based support to filter down to "preferred" CRUDRepository instances.
Thanks ahead of time for reviewing this.
Affects: 2.2.2 (Evans SR2)
Attachments:
- Repositories.java (13.63 kB)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.