spring-projects / spring-projects/spring-data-commons
Check for type compatibility of parameter types with their corresponding entity properties [DATACMNS-372]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
Description
Thomas Darimont opened DATACMNS-372 and commented
At present we ensure at bootstrapping time that every property that is derived from a Repository finder method like findByFirstnameAndLastname(String firstname, String lastname) -> firstname, lastname is present on the persistent entity.
An additional check that we currently do not do would be to test whether the type of the corresponding parameter of that particular finder method is compatible with the type of the property of the persistent entity.
This would allow us to find potential errors at bootstrapping time findByFirstnameAndLastname(Float firstname, Double lastname).
In addition to that this check could also be added to the SD support in the STS IDE
No further details from DATACMNS-372
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 tracing the bootstrapping validation for repository finder methods and how finder parameters are matched to persistent entity properties. Add coverage showing incompatible parameter and property types are detected at bootstrapping time; the issue also mentions possible Spring Tool Suite support, but gives no specific files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100