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
Support converting Sort to Comparator [DATACMNS-1678] #2099
Comments
Mark Paluch commented Thanks for the ticket. That is an interesting thought. We never evaluated really in-memory processing of data and having a |
Martin Konštiak commented There's already PR with first proposal: #433 |
Oliver Drotbohm commented As I might not be properly available in the team call this afternoon, some thoughts on this. I fundamentally like the idea of a I also see a couple of other risks:
Especially the latter makes me think that we're looking at something that looks easy on the surface but bears quite a bit of unanticipated complexity. Edit: looking at the PR, it looks like that helper class to create |
Mark Paluch commented I second Ollie's opinion here. At first sight, it's a neat extension. I also share the main concern regarding property accessors. This utility would require to be tied to To stick with a consistent way of retrieving properties, obtaining a |
Martin Konštiak commented Thanks for suggestions. I agree with your points for reusing existing property accessing functionality. I tried to orientate in PersistentEntity/PersistentPropertyAccessor/MappingContext but I've got lost there. Is it possible to explain it on more specific examples? I tried to use org.springframework.beans.BeanWrapperImpl but it looks it wasn't designed for such purpose (NullValueInNestedPathException) |
Oliver Drotbohm commented There's hardly any way to make this work using the We could probably find a solution but that would require significant rework of abstractions and packages and would probably still end up creating more complexity for all other use cases due to additional indirections |
Mark Paluch commented After reiterating here, we couldn't convince ourselves to add your contribution. Probably there should be a separate place outside of Spring Data where this extension could live in. |
spring-projects-issues commentedMar 10, 2020
Martin Konštiak opened DATACMNS-1678 and commented
I'd like to apply Sort to Collection or Stream. Thanks to reflection it's possible to convert each Sort.Order to Comparator and then chain them into one. And then use this Comparator as parameter for Stream.sorted method
No further details from DATACMNS-1678
The text was updated successfully, but these errors were encountered: