You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: Query parameters of type `Class` are inspected whether they qualify as dynamic projection parameter.
58
58
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.
59
59
If you want to use a `Class` parameter as query argument then make sure to use a different generic parameter, for example `Class<?>`.
60
+
61
+
[NOTE]
62
+
====
63
+
When using <<projections.dtos,Class-based projection>>, types must declare a single constructor so that Spring Data can determine their input properties.
64
+
If your class defines more than one constructor, then you cannot use the type without further hints for DTO projections.
65
+
In such a case annotate the desired constructor with `@PersistenceCreator` as outlined below so that Spring Data can determine which properties to select:
66
+
67
+
[source,java]
68
+
----
69
+
public class NamesOnly {
70
+
71
+
private final String firstname;
72
+
private final String lastname;
73
+
74
+
protected NamesOnly() { }
75
+
76
+
@PersistenceCreator
77
+
public NamesOnly(String firstname, String lastname) {
0 commit comments