From aced37284489f83b77cd063d817af54fcb8c2913 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Tue, 5 Sep 2023 21:49:32 +0200 Subject: [PATCH] add two more @HQL method examples to doc --- .../src/main/asciidoc/introduction/Generator.adoc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/documentation/src/main/asciidoc/introduction/Generator.adoc b/documentation/src/main/asciidoc/introduction/Generator.adoc index 0c8ce4ca5f..7ec21cd75c 100644 --- a/documentation/src/main/asciidoc/introduction/Generator.adoc +++ b/documentation/src/main/asciidoc/introduction/Generator.adoc @@ -578,6 +578,12 @@ But when there's just one item in the `select` list, the type of that item shoul String getBookTitleByIsbn(String isbn); ---- +[source,java] +---- +@HQL("select local datetime") +LocalDateTime getServerDateTime(); +---- + A query which returns a selection list may have a query method which repackages the result as a record, as we saw in <>. [source,java] @@ -640,7 +646,13 @@ An `insert`, `update`, or `delete` query must return `int` or `void`. [source,java] ---- @HQL("delete from Book") -void deleteAllBooks(); +int deleteAllBooks(); +---- + +[source,java] +---- +@HQL("update Book set discontinued = true where isbn = :isbn") +void discontinueBook(String isbn); ---- On the other hand, finder methods are currently much more limited.