Skip to content

Document Vavr collection types as query method parameters - #3526

Open
AzazelSensei wants to merge 2 commits into
spring-projects:mainfrom
AzazelSensei:docs/3525-vavr-query-params
Open

Document Vavr collection types as query method parameters#3526
AzazelSensei wants to merge 2 commits into
spring-projects:mainfrom
AzazelSensei:docs/3525-vavr-query-params

Conversation

@AzazelSensei

Copy link
Copy Markdown

The Vavr section only talked about return types. Those wrappers are also unwrapped on the way in (ParametersParameterAccessor / QueryExecutionConverters), so findByStatusIn(io.vavr.collection.List) is a regular IN clause.

Fixes #3525

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 spring-projects#3525

Signed-off-by: Abdullah <89297042+AzazelSensei@users.noreply.github.com>
@AzazelSensei
AzazelSensei force-pushed the docs/3525-vavr-query-params branch from 5cd587d to cc3441e Compare August 13, 2026 15:22
@fResult

fResult commented Aug 14, 2026

Copy link
Copy Markdown

Hi, @AzazelSensei,
Thanks so much for taking this and submitting the PR!

I have a couple of suggestions to make the documentation clearer and cover the items mentioned in the #3525 issue:

1. Refine phrasing in query-methods-details.adoc:L281-283

  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<Long> 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`).

  The same types are also accepted as query method *parameters*.

2. Update table entry in query-return-types-reference.adoc:L30

- |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.

Let me know what you think.
And thx again for your help! 🙌

@AzazelSensei

Copy link
Copy Markdown
Author

Took your wording. The Vavr section now has the 2.0 unwrap, Traversable, and the findAllByIdIn example. Table row mentions parameters too.

Cover the 2.0 unwrap, Traversable, and the table row.

Signed-off-by: Abdullah <89297042+AzazelSensei@users.noreply.github.com>
@AzazelSensei
AzazelSensei force-pushed the docs/3525-vavr-query-params branch from be9e75e to a2e8fc5 Compare August 14, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: "Support for Vavr Collections" doesn't mention Vavr types are also unwrapped when used as repository method parameters

3 participants