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..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,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. +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]] == Streaming Query Results 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.