Skip to content

Commit

Permalink
Update class-based DTO notes in reference docs.
Browse files Browse the repository at this point in the history
Closes #2558.
Related: #2635.
  • Loading branch information
gregturn committed Sep 29, 2022
1 parent c116755 commit 5f14859
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NOTE: Class based projections do not work with native queries. As a workaround you may use named queries with `ResultSetMapping` or the Hibernate specific https://docs.jboss.org/hibernate/orm/6.0/javadocs/org/hibernate/transform/ResultTransformer.html[`ResultTransformer`]
NOTE: 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`. (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. And it's important to point out that class-based projections do not work with native queries AT ALL. As a workaround you may use named queries with `ResultSetMapping` or the Hibernate specific https://docs.jboss.org/hibernate/orm/6.0/javadocs/org/hibernate/transform/ResultTransformer.html[`ResultTransformer`]

0 comments on commit 5f14859

Please sign in to comment.