Skip to content

Document Vavr collection types as query method parameters - #3526

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

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

Conversation

@AzazelSensei

Copy link
Copy Markdown
Contributor

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
Contributor 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
@mp911de mp911de self-assigned this Aug 26, 2026
@mp911de mp911de added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 26, 2026
@mp911de mp911de added this to the 4.0.8 (2025.1.8) milestone Aug 26, 2026
mp911de pushed a commit that referenced this pull request Aug 26, 2026
Closes #3525
Original pull request: #3526

Signed-off-by: Abdullah <89297042+AzazelSensei@users.noreply.github.com>
mp911de added a commit that referenced this pull request Aug 26, 2026
Minor wording tweaks.

See #3525
Original pull request: #3526
mp911de pushed a commit that referenced this pull request Aug 26, 2026
Closes #3525
Original pull request: #3526

Signed-off-by: Abdullah <89297042+AzazelSensei@users.noreply.github.com>
mp911de added a commit that referenced this pull request Aug 26, 2026
Minor wording tweaks.

See #3525
Original pull request: #3526
mp911de pushed a commit that referenced this pull request Aug 26, 2026
Closes #3525
Original pull request: #3526

Signed-off-by: Abdullah <89297042+AzazelSensei@users.noreply.github.com>
mp911de added a commit that referenced this pull request Aug 26, 2026
Minor wording tweaks.

See #3525
Original pull request: #3526
@mp911de

mp911de commented Aug 26, 2026

Copy link
Copy Markdown
Member

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: documentation A documentation update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Vavr Collections doesn't mention usage as repository query method parameters

4 participants