This is an automated email from the ASF dual-hosted git repository. jamesfredley pushed a commit to branch test/h7-functional-coverage in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit fcf88e96b5e7bd46d99f783837de3aaee727f091 Author: James Fredley <[email protected]> AuthorDate: Thu Jun 11 14:17:11 2026 -0400 Document Hibernate 7 finder and getAll behavior Assisted-by: Hephaestus:openai/gpt-5.5 --- .../docs/src/docs/asciidoc/quickStartGuide/basicCRUD.adoc | 7 +++++++ grails-doc/src/en/ref/Domain Classes/findAllWhere.adoc | 5 +++++ grails-doc/src/en/ref/Domain Classes/findWhere.adoc | 5 +++++ grails-doc/src/en/ref/Domain Classes/getAll.adoc | 2 ++ 4 files changed, 19 insertions(+) diff --git a/grails-data-hibernate7/docs/src/docs/asciidoc/quickStartGuide/basicCRUD.adoc b/grails-data-hibernate7/docs/src/docs/asciidoc/quickStartGuide/basicCRUD.adoc index 1f78dce296..ca1b0e1d8e 100644 --- a/grails-data-hibernate7/docs/src/docs/asciidoc/quickStartGuide/basicCRUD.adoc +++ b/grails-data-hibernate7/docs/src/docs/asciidoc/quickStartGuide/basicCRUD.adoc @@ -46,6 +46,9 @@ def book = Book.get(999) // null // Get multiple by IDs def books = Book.getAll(1, 2, 3) +// The returned list preserves the supplied id order +def books = Book.getAll(3, 1, 2) + // Load a proxy (no immediate SELECT) def book = Book.load(1) @@ -59,6 +62,10 @@ def books = Book.list(max: 10, offset: 0, sort: 'title', order: 'asc') def book = Book.findByTitle('Groovy in Action') def books = Book.findAllByAuthor('Dierk König') def count = Book.countByAuthor('Dierk König') + +// Property-map queries; null values match null properties +def unreleased = Book.findWhere(releaseDate: null) +def matching = Book.findAllWhere(author: 'Dierk König', releaseDate: null) ---- === Update diff --git a/grails-doc/src/en/ref/Domain Classes/findAllWhere.adoc b/grails-doc/src/en/ref/Domain Classes/findAllWhere.adoc index 2ca643b29c..8ce1c9380f 100644 --- a/grails-doc/src/en/ref/Domain Classes/findAllWhere.adoc +++ b/grails-doc/src/en/ref/Domain Classes/findAllWhere.adoc @@ -60,6 +60,11 @@ def unreleasedBooks = Book.findAllWhere(releaseDate: null) === Description +`findAllWhere` returns all matching instances. A `null` value in the argument map matches rows where that property is `null`. + +Only domain class property names may be used as keys in the argument map. Invalid property names are rejected instead of being interpolated into the generated query. + Parameters: * `queryParams` - A Map of key/value pairs to be used in the query +* `args` - Optional query arguments such as `max`, `offset`, `cache`, `readOnly`, `fetchSize`, `timeout`, `flushMode`, and `lock` diff --git a/grails-doc/src/en/ref/Domain Classes/findWhere.adoc b/grails-doc/src/en/ref/Domain Classes/findWhere.adoc index 591bd0ab91..5dce3895c1 100644 --- a/grails-doc/src/en/ref/Domain Classes/findWhere.adoc +++ b/grails-doc/src/en/ref/Domain Classes/findWhere.adoc @@ -62,6 +62,11 @@ boolean isReleased = Book.findWhere(author: "Stephen King", === Description +`findWhere` returns the first matching instance, or `null` when no instance matches. A `null` value in the argument map matches rows where that property is `null`. + +Only domain class property names may be used as keys in the argument map. Invalid property names are rejected instead of being interpolated into the generated query. + Parameters: * `queryParams` - A `Map` of key/value pairs to be used in the query +* `args` - Optional query arguments such as `offset`, `cache`, `readOnly`, `fetchSize`, `timeout`, `flushMode`, and `lock`. `findWhere` always limits the query to one result. diff --git a/grails-doc/src/en/ref/Domain Classes/getAll.adoc b/grails-doc/src/en/ref/Domain Classes/getAll.adoc index bd8d3fc1e1..e9fb04f576 100644 --- a/grails-doc/src/en/ref/Domain Classes/getAll.adoc +++ b/grails-doc/src/en/ref/Domain Classes/getAll.adoc @@ -48,6 +48,8 @@ def bookList = Book.getAll() === Description +The returned list preserves the order of the ids supplied by the caller. If an id is `null` or does not exist, the corresponding position in the returned list is `null`. + Parameters: * `varargs`* - A variable argument list of ids
