spring-projects / spring-projects/spring-tools
[type-safe property references] find domain type when not directly referenced
@BoykoAlex is already working on this.
Since Mar 31, 2026.
- Dominant language
- Java
- Stars
- 983
- Forks
- 240
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 7
Description
Having the query creation extracted into a method like this:
private Query getQueryDef() {
return query(where("name").is("Porsche"));
}
the warning about the type unsafe property reference appears, but there is no information about the domain type showing up and no quick fix is around. Would be interesting to investigate how much we could do in this case.
In this case, I have the call-side in the same file in a different method:
@Test
void queryFilterWithStringPropertyPath() {
List<Category> all = template.findAll(getQueryDef(), Category.class);
}
Interestingly, asking the AI assistant to fix the issue works here, probably because there are other code snippets included in the same file with type-reference property references being used.
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.