Skip to content

Commit

Permalink
Document dynamic projections parameter detection.
Browse files Browse the repository at this point in the history
Closes #2510
  • Loading branch information
mp911de committed Jan 25, 2022
1 parent 05260bf commit 13f9657
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/asciidoc/repository-projections.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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<?>`.

0 comments on commit 13f9657

Please sign in to comment.