Consider enclosing class for dynamic projection parameter detection.

We now consider the enclosing class to determine correct generic typing.

Closes #3020
This commit is contained in:
Mark Paluch
2024-01-11 11:04:46 +01:00
parent 6623bd8d91
commit 0093c9085b
4 changed files with 22 additions and 4 deletions

View File

@@ -260,7 +260,7 @@ public class Parameter {
throw new IllegalArgumentException("Parameter is not associated with any method");
}
var returnType = TypeInformation.fromReturnTypeOf(method);
var returnType = TypeInformation.fromReturnTypeOf(method, parameter.getContainingClass());
var unwrapped = QueryExecutionConverters.unwrapWrapperTypes(returnType);
var reactiveUnwrapped = ReactiveWrapperConverters.unwrapWrapperTypes(unwrapped);

View File

@@ -146,7 +146,7 @@ public abstract class QuerydslPredicateArgumentResolverSupport {
throw new IllegalArgumentException("Method parameter is not backed by a method");
}
return detectDomainType(TypeInformation.fromReturnTypeOf(method));
return detectDomainType(TypeInformation.fromReturnTypeOf(method, parameter.getContainingClass()));
}
private static TypeInformation<?> detectDomainType(TypeInformation<?> source) {