Skip to content

Only the contents of collections gets converted. #1356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

schauder
Copy link
Contributor

Contents of Iterables that aren't collections will not be converted individually.

Closes #1343
Replaces #1345

@schauder schauder requested a review from mp911de October 11, 2022 14:58
@schauder schauder mentioned this pull request Oct 11, 2022
4 tasks
@tunacicek
Copy link

Do you have an approximate timeline for when this PR will be merged/released?

@LuLeRoemer
Copy link

LuLeRoemer commented Feb 16, 2023

@mp911de @schauder do you have an idea when we can expect this PR to be merged? We are waiting for this as it is supposed to fix #1323. Thanks in advance!

Simplify test.

See #1343
Contents of Iterables that aren't collections will not be converted individually.

Closes #1343
@schauder schauder force-pushed the issue/1343-converter-for-iterable branch from e4e7a2b to 365586c Compare February 16, 2023 14:40
Copy link
Member

@mp911de mp911de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment on the PR. Do you want to update this one or do you want me to look into this?

@@ -189,7 +190,7 @@ private void convertAndAddParameter(MapSqlParameterSource parameters, Parameter
Assert.notNull(type, "@Query parameter type could not be resolved");

JdbcValue jdbcValue;
if (value instanceof Iterable) {
if (value instanceof Collection && resolvableType.hasGenerics()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make sense to follow our general conventions to include Iterable and Streamable types but exclude custom domain types that implement Iterable.

See https://github.com/spring-projects/spring-data-commons/blob/main/src/main/java/org/springframework/data/util/TypeDiscoverer.java#L118-L126 for further reference. Also, we should consider CustomCollections to support usage of e.g. vavr collection types as follow up.

@schauder
Copy link
Contributor Author

schauder commented Mar 7, 2023

@mp911de I'd appreciate it if you could look into this.

@mp911de mp911de self-assigned this Mar 7, 2023
mp911de pushed a commit that referenced this pull request Mar 15, 2023
Simplify test.

Original pull request: #1356
See #1343
mp911de pushed a commit that referenced this pull request Mar 15, 2023
Contents of Iterables that aren't collections will not be converted individually.

Closes #1343
Original pull request: #1356
mp911de added a commit that referenced this pull request Mar 15, 2023
Simplify TypeInformation creation from a MethodParameter.

Original pull request: #1356
See #1343
mp911de pushed a commit that referenced this pull request Mar 15, 2023
Simplify test.

Original pull request: #1356
See #1343
@mp911de mp911de added the type: bug A general bug label Mar 15, 2023
mp911de pushed a commit that referenced this pull request Mar 15, 2023
Contents of Iterables that aren't collections will not be converted individually.

Closes #1343
Original pull request: #1356
mp911de added a commit that referenced this pull request Mar 15, 2023
Simplify TypeInformation creation from a MethodParameter.

Original pull request: #1356
See #1343
@mp911de
Copy link
Member

mp911de commented Mar 15, 2023

That's merged and backported now.

@mp911de mp911de closed this Mar 15, 2023
@mp911de mp911de deleted the issue/1343-converter-for-iterable branch March 15, 2023 16:03
@mp911de mp911de added this to the 3.0.4 (2022.0.4) milestone Mar 15, 2023
@mp911de mp911de added type: regression A regression from a previous release and removed type: bug A general bug labels Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom converter not used for Iterable type from 2.4.1
4 participants