-
Notifications
You must be signed in to change notification settings - Fork 682
Consider vavr collections to be collection like #2511
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
Conversation
Assuming we accepted the contribution, |
Since But then I ran into the problem that my converter is called with a java util List with unconverted Bson elements in the List. So I needed a pretty dirty hack to make it work. After inspecting the
Since you now need a custom converter anyways for mapping vavr lists and the custom converter is executed before anything else, nothing would change for However, I don't know, how this change would affect other libraries. But I would guess that since "coellctionLike" is not the same as " |
That's very useful feedback, thanks! We were thinking in a similar direction. There already is a converter able to map between the native Java types and Vavr collections, but it's currently only used to adapt results returned from the internal execution of query methods that declare Vavr types. I.e. for those, the actual execution produces e.g. a Java I guess I'll see if registering that as converter in |
…rsions. Moved Vavr collection converters into a type in the utility package. Register the converters via CustomConversions.registerConvertersIn(…) to make sure that all the Spring Data object mapping converters automatically benefit from a ConversionService that is capable of translating between Java-native collections and Vavr ones. Issue #2511.
…rsions. Moved Vavr collection converters into a type in the utility package. Register the converters via CustomConversions.registerConvertersIn(…) to make sure that all the Spring Data object mapping converters automatically benefit from a ConversionService that is capable of translating between Java-native collections and Vavr ones. Issue #2511.
The suggested changes have been polished and merged, just as the ones in #2517. That said, we still haven't made up our mind on how to adapt the actual object mapping converters in the store implementations. I.e. domain objects will currently not map properly as the code that sees |
I got the chance to test it today with 2.7.0-M3 and it is working now. I can even remove some of my custom reading converters. Thank you for your effort. |
Apparently vavr collections are currently not considered collection like.
To treat them as collection correclty for example in
MappingMongoConverter
fromspring-data-mongodb
they should also be considered collection like.