spring-projects / spring-projects/spring-tools

[type-safe property references] find domain type when not directly referenced

Open
#1,863 0 comments 0 reactions 1 assignee View on GitHub

@BoykoAlex is already working on this.

Since Mar 31, 2026.

for: eclipse for: vscode theme: spring-data-support theme: validation type: enhancement
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

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.