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.
Having the query creation extracted into a method like this:
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:
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.