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

Provide means to expose custom repository methods [DATAREST-206]

Open
#588 11 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

has: votes-jira type: enhancement
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

Aaron Loes opened DATAREST-206 and commented

i have custom methods in my repository and interface that are not showing up in my search links ... no search link at all. I believe the line at fault is in DefaultRepositoryInformation#isQueryMethodCandidate

private boolean isQueryMethodCandidate(Method method) {
	return isQueryAnnotationPresentOn(method) || !isCustomMethod(method) && !isBaseClassMethod(method);
}

i would think that if a method is a custom method (defined in interface and implementing class but is NOT a method in the base repository class, then it should be a candidate for a query method. So shouldn't the method be as such?

private boolean isQueryMethodCandidate(Method method) {
	return isQueryAnnotationPresentOn(method) || isCustomMethod(method) && !isBaseClassMethod(method);
}

Affects: 2.0 M1 (Codd)

Issue Links:

  • DATAREST-850 Return custom methos if enables
    ("is duplicated by")

  • DATAREST-158 Exposing custom repositories
    ("is duplicated by")

  • DATAREST-469 Introduce dedicated resource type for search links

  • DATACMNS-584 Don't resolve query for custom methods that are annotated by @Query

17 votes, 22 watchers

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.