Skip to content

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

@martinlippert

Description

@martinlippert

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions