spring-projects / spring-projects/spring-data-commons
method derivation for Specification<...>
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
Description
This is a suggestion.
I was looking into using Specification on a repository. The combinators and/or were interesting, but building the primitive specification with the criteria API seemed rough. Then I thought the technology already exists with method derivation. Something like:
interface Products extends CrudRepository<....> {
Specification<Product> byName(String name);
Specification<Product> byPriceLessThan(BigDecimal price);
)
The client can then combine them:
Products products = ...;
var spec = products.byName("bag").and(products.priceLessThan(BigDecimal.ONE));
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.
Research direction
Start by reading the existing Specification combinators and repository method-derivation entry points; the issue names no files or tests. Compare the proposed repository declarations with the current criteria API, and determine the scope needed for composable specifications. Done means the proposal has an agreed design and an identified implementation and test plan.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100