Skip to content

Commit e55de1a

Browse files
committed
Reorder documentation of class-based projection support for JPA Native Queries.
Closes #3599
1 parent 074bfec commit e55de1a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
[[jpa.projections]]
22
= Projections
33

4-
include::{commons}@data-commons::page$repositories/projections.adoc[leveloffset=+1]
4+
:projection-collection: Collection
5+
6+
include::{commons}@data-commons::page$repositories/projections-intro.adoc[]
57

68
NOTE: It is important to note that <<projections.dtos,Class-based projections>> with JPQL is limited to *constructor expressions* in your JPQL expression, e.g. `SELECT new com.example.NamesOnly(u.firstname, u.lastname) from User u`.
79
(Note the usage of a FQDN for the DTO type!) This JPQL expression can be used in `@Query` annotations as well where you define any named queries.
810
And it's important to point out that class-based projections do not work with native queries AT ALL.
911
As a workaround you may use named queries with `ResultSetMapping` or the Hibernate-specific javadoc:{hibernatejavadocurl}org.hibernate.query.ResultListTransformer[]
12+
13+
include::{commons}@data-commons::page$repositories/projections-interface.adoc[leveloffset=1]
14+
15+
include::{commons}@data-commons::page$repositories/projections-class.adoc[leveloffset=1]
16+
17+

0 commit comments

Comments
 (0)