From d1c69b80f0b6688ccda4f7a446ee8712802f4183 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 12 Aug 2024 09:28:43 +0200 Subject: [PATCH] Polishing. Use Javadoc macro. Reformat code. See #3544 --- .../antora/modules/ROOT/pages/repositories/projections.adoc | 5 ++++- src/main/antora/resources/antora-resources/antora.yml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/antora/modules/ROOT/pages/repositories/projections.adoc b/src/main/antora/modules/ROOT/pages/repositories/projections.adoc index 69d62d3716..d34f5f5f56 100644 --- a/src/main/antora/modules/ROOT/pages/repositories/projections.adoc +++ b/src/main/antora/modules/ROOT/pages/repositories/projections.adoc @@ -3,4 +3,7 @@ include::{commons}@data-commons::page$repositories/projections.adoc[leveloffset=+1] -NOTE: It is important to note that <> 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/query/TupleTransformer.html[`TupleTransformer`] and https://docs.jboss.org/hibernate/orm/6.0/javadocs/org/hibernate/query/ResultListTransformer.html[`ResultListTransformer`] +NOTE: It is important to note that <> 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 javadoc:{hibernatejavadocurl}org.hibernate.query.ResultListTransformer[] diff --git a/src/main/antora/resources/antora-resources/antora.yml b/src/main/antora/resources/antora-resources/antora.yml index 4b911037b3..ed14d8c6d8 100644 --- a/src/main/antora/resources/antora-resources/antora.yml +++ b/src/main/antora/resources/antora-resources/antora.yml @@ -16,5 +16,6 @@ asciidoc: spring-framework-docs: '{springdocsurl}' spring-framework-javadoc: '{springjavadocurl}' springhateoasversion: ${spring-hateoas} + hibernatejavadocurl: https://docs.jboss.org/hibernate/orm/6.6/javadocs/ releasetrainversion: ${releasetrain} store: Jpa