Skip to content

Commit a82a8ca

Browse files
committed
Polishing.
See #3080
1 parent 553467f commit a82a8ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/antora/modules/ROOT/pages/jpa/query-methods.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,6 @@ public interface GroupRepository extends CrudRepository<GroupInfo, String> {
776776
[[projections]]
777777
== Projections
778778

779-
Spring Data JPA supports {spring-data-commons-docs-url}/repository-projects.html[Spring Data Commons Projections].
779+
Spring Data JPA supports {spring-data-commons-docs-url}/repository-projections.html[Spring Data Commons Projections].
780780

781-
NOTE: It is important to note that {spring-data-commons-docs-url}/repository-projects.html#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`. (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`]
781+
NOTE: It is important to note that {spring-data-commons-docs-url}/repository-projections.html#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`. (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 commit comments

Comments
 (0)