From 280df7c98d22c385fd420e77c1b21e1bf620f7a3 Mon Sep 17 00:00:00 2001 From: Gavin Date: Mon, 29 May 2023 12:41:23 +0200 Subject: [PATCH] fix javax package name + minor code example errors (spotted by @andrei-ivanov) --- .../src/main/asciidoc/querylanguage/Concepts.adoc | 8 ++++---- .../userguide/chapters/query/hql/QueryLanguage.adoc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/src/main/asciidoc/querylanguage/Concepts.adoc b/documentation/src/main/asciidoc/querylanguage/Concepts.adoc index 703d2fbaec..f69073d309 100644 --- a/documentation/src/main/asciidoc/querylanguage/Concepts.adoc +++ b/documentation/src/main/asciidoc/querylanguage/Concepts.adoc @@ -601,7 +601,7 @@ for (var result : results) { This is bearable, but let's explore some other options. -JPA lets us specify that we want each query result packaged as an instance of `javax.persistence.Tuple`. +JPA lets us specify that we want each query result packaged as an instance of `jakarta.persistence.Tuple`. All we have to do is pass the class `Tuple` to `createQuery()`. [source, java] @@ -630,8 +630,8 @@ var results = Map.class) .getResultList(); for (var map : results) { - String title = (String) tuple.get("title"); - String preamble = (String) tuple.get("preamble"); + String title = (String) map.get("title"); + String preamble = (String) map.get("preamble"); } ---- [source, java] @@ -643,7 +643,7 @@ var results = .getResultList(); for (var list : results) { String title = (String) list.get(0); - String preamble = (String) tuple.get(1); + String preamble = (String) list.get(1); } ---- diff --git a/documentation/src/main/asciidoc/userguide/chapters/query/hql/QueryLanguage.adoc b/documentation/src/main/asciidoc/userguide/chapters/query/hql/QueryLanguage.adoc index ccbb965487..bddd69c85a 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/query/hql/QueryLanguage.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/query/hql/QueryLanguage.adoc @@ -1939,7 +1939,7 @@ There's no need to bother with trying to represent a "tuple of length 1". But if there are multiple expressions in the select list then: - by default, each query result is packaged as an array of type `Object[]`, or -- if explicitly requested by passing the class `Tuple` to `createQuery()`, the query result is packaged as an instance of `javax.persistence.Tuple`. +- if explicitly requested by passing the class `Tuple` to `createQuery()`, the query result is packaged as an instance of `jakarta.persistence.Tuple`. [[hql-select-clause-projection-example]] //.Query results as lists