Document dynamic projections parameter detection.

Closes #2510
This commit is contained in:
Mark Paluch
2022-01-25 09:50:29 +01:00
parent 16bbaf5886
commit d4dea42509

View File

@@ -304,7 +304,7 @@ This way, the method can be used to obtain the aggregates as is or with a projec
.Using a repository with dynamic projections
====
[source, java, subs="+attributes"]
[source,java,subs="+attributes"]
----
void someMethod(PersonRepository people) {
@@ -316,3 +316,7 @@ void someMethod(PersonRepository people) {
}
----
====
NOTE: Query parameters of type `Class` are inspected whether they qualify as dynamic projection parameter.
If the actual return type of the query equals the generic parameter type of the `Class` parameter, then the matching `Class` parameter is not available for usage within the query or SpEL expressions.
If you want to use a `Class` parameter as query argument then make sure to use a different generic parameter, for example `Class<?>`.