From cc3441e76db840239f291831158fea4a2611da08 Mon Sep 17 00:00:00 2001 From: Abdullah <89297042+AzazelSensei@users.noreply.github.com> Date: Thu, 13 Aug 2026 18:16:13 +0300 Subject: [PATCH 1/2] Document Vavr collection types as query method parameters The section only talked about return types. Seq/Set/Map are unwrapped to Java collections on the way in, so IN queries work. Option unwraps to its value or null, not to Optional. Fixes #3525 Signed-off-by: Abdullah <89297042+AzazelSensei@users.noreply.github.com> --- .../ROOT/pages/repositories/query-methods-details.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc b/src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc index a79b668347..c57a632e74 100644 --- a/src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc +++ b/src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc @@ -280,6 +280,10 @@ You can use the types in the first column (or subtypes thereof) as query method Alternatively, you can declare `Traversable` (the Vavr `Iterable` equivalent), and we then derive the implementation class from the actual return value. That is, a `java.util.List` is turned into a Vavr `List` or `Seq`, a `java.util.Set` becomes a Vavr `LinkedHashSet` `Set`, and so on. +The same types are also accepted as query method *parameters*. +Spring Data unwraps a Vavr `Seq`, `Set`, or `Map` argument to a Java collection before the store sees it, so a derived query such as `findByStatusIn(io.vavr.collection.List statuses)` binds as a regular `IN` clause. +A Vavr `Option` argument is unwrapped to its value (or `null`), not to `java.util.Optional`. + [[repositories.query-streaming]] == Streaming Query Results From a2e8fc561c70fa61af9ddbc512613e4b49a9622a Mon Sep 17 00:00:00 2001 From: Abdullah <89297042+AzazelSensei@users.noreply.github.com> Date: Fri, 14 Aug 2026 12:00:06 +0300 Subject: [PATCH 2/2] Document Vavr query parameter unwrapping more clearly Cover the 2.0 unwrap, Traversable, and the table row. Signed-off-by: Abdullah <89297042+AzazelSensei@users.noreply.github.com> --- .../ROOT/pages/repositories/query-methods-details.adoc | 6 +++--- .../pages/repositories/query-return-types-reference.adoc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc b/src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc index c57a632e74..f69cfd63b7 100644 --- a/src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc +++ b/src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc @@ -280,9 +280,9 @@ You can use the types in the first column (or subtypes thereof) as query method Alternatively, you can declare `Traversable` (the Vavr `Iterable` equivalent), and we then derive the implementation class from the actual return value. That is, a `java.util.List` is turned into a Vavr `List` or `Seq`, a `java.util.Set` becomes a Vavr `LinkedHashSet` `Set`, and so on. -The same types are also accepted as query method *parameters*. -Spring Data unwraps a Vavr `Seq`, `Set`, or `Map` argument to a Java collection before the store sees it, so a derived query such as `findByStatusIn(io.vavr.collection.List statuses)` binds as a regular `IN` clause. -A Vavr `Option` argument is unwrapped to its value (or `null`), not to `java.util.Optional`. +These Vavr types are also accepted as query method *parameters* (as of 2.0). If a repository method parameter uses one of the types above (or `Traversable`), Spring Data automatically unwraps it into its Java-native equivalent before executing the query. + +For example, a derived query method declared as `findAllByIdIn(io.vavr.collection.List ids)` accepts a Vavr `List` and unwraps it to a `java.util.List` so it binds correctly as an `IN`-clause. A Vavr `Option` parameter is similarly unwrapped to its inner value (or `null`). [[repositories.query-streaming]] diff --git a/src/main/antora/modules/ROOT/pages/repositories/query-return-types-reference.adoc b/src/main/antora/modules/ROOT/pages/repositories/query-return-types-reference.adoc index 5ae8b6e2e7..abd965d144 100644 --- a/src/main/antora/modules/ROOT/pages/repositories/query-return-types-reference.adoc +++ b/src/main/antora/modules/ROOT/pages/repositories/query-return-types-reference.adoc @@ -27,7 +27,7 @@ Some store modules may define their own result wrapper types. |`Stream`|A Java `Stream`. |`Streamable`|A convenience extension of `Iterable` that directly exposes methods to stream, map and filter results, concatenate them etc. |Types that implement `Streamable` and take a `Streamable` constructor or factory method argument|Types that expose a constructor or `….of(…)`/`….valueOf(…)` factory method taking a `Streamable` as argument. See xref:repositories/query-methods-details.adoc#repositories.collections-and-iterables.streamable-wrapper[Returning Custom Streamable Wrapper Types] for details. -|Vavr `Seq`, `List`, `Map`, `Set`|Vavr collection types. See xref:repositories/query-methods-details.adoc#repositories.collections-and-iterables.vavr[Support for Vavr Collections] for details. +|Vavr `Seq`, `List`, `Map`, `Set`|Vavr collection types, also accepted as query method parameters. See xref:repositories/query-methods-details.adoc#repositories.collections-and-iterables.vavr[Support for Vavr Collections] for details. |`Future`|A `Future`. Expects a method to be annotated with `@Async` and requires Spring's asynchronous method execution capability to be enabled. |`CompletableFuture`|A `CompletableFuture`. Expects a method to be annotated with `@Async` and requires Spring's asynchronous method execution capability to be enabled. |`Slice`|A sized chunk of data with an indication of whether there is more data available. Requires a `Pageable` method parameter.