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

Customize UserDomainType to CRUDRepository Mapping [DATAREST-472]

Open
#851 0 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

in: repository type: enhancement
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:

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.