Skip to content

Commit fe11f81

Browse files
christophstroblmp911de
authored andcommitted
Update Projection section in reference documentation.
For the time being we at least now document the current behaviour and how to cope with it. Closes: #3286 Original pull request: #3449
1 parent 16448d8 commit fe11f81

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/main/antora/modules/ROOT/pages/repositories/projections.adoc

+25
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,28 @@ include::{commons}@data-commons::page$repositories/projections-interface.adoc[le
1515
include::{commons}@data-commons::page$repositories/projections-class.adoc[leveloffset=1]
1616

1717

18+
19+
[NOTE]
20+
====
21+
Some JPA providers may require additional hints when working with <<projections.dtos,Class-based projections>> especially when using those directly with method derived queries.
22+
If you are facing errors like `JpaSystemException: Specified result type did not match Query selection type` make sure to provide a constructor hint via `@PersistenceCreator` to be passed on, as outlined below:
23+
24+
[source,java]
25+
----
26+
public class NamesOnly {
27+
28+
private final String firstname;
29+
private final String lastname;
30+
31+
protected NamesOnly() { }
32+
33+
@PersistenceCreator
34+
public NamesOnly(String firstname, String lastname) {
35+
this.firstname = firstname;
36+
this.lastname = lastname;
37+
}
38+
39+
// ...
40+
}
41+
----
42+
====

0 commit comments

Comments
 (0)