-
Notifications
You must be signed in to change notification settings - Fork 682
DATACMNS-1762 - Support Optional wrapping for projection getters #459
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
…ionConverters. ReactiveWrappers doesn't belong in there in the first place so we're removing ReactiveWrappers support from QueryExecutionConverters so ReactiveWrappers is used from parts that need to be reactive-aware.
…Converters. Nullable wrappers such as Java 8 Optional, Guava Optional, Scala Option and Vavr Option are now handled in NullableWrapperConverters and are no longer coupled to QueryExecutionConverters so that this functionality can be reused.
We now support nullable wrappers for projection interfaces. Getters are inspected whether their return type is a supported nullable wrapper. If so, then the value can be wrapped into that type. Null values default in that case to their corresponding empty wrapper representation.
} | ||
|
||
@Test // DATACMNS-1762 | ||
void supportsOptionalBackedByOptional() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting test! Did not think about this use case 👍
} | ||
} | ||
|
||
public static final class WrapperType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably an exact copy of QueryExecutionConverters.WrapperType
. Shouldn't this be refactored to use the same class? Or is that not possible for backwards-compatibility reasons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really want to expose this type so it makes sense to make it package-private. We'd rather go for a duplication really as nullable wrappers and result wrappers (Page
, Seq
, CompletableFuture
) touch different concepts which follow a similar structure but they aren't the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, clear! Looking forward to using this in a future release :-)
Thanks for this @mp911de ! I have added 2 remarks above from having a look at what you have done. I could not have done it myself, so I'm very grateful for this 🙇 |
…ionConverters. ReactiveWrappers doesn't belong in there in the first place so we're removing ReactiveWrappers support from QueryExecutionConverters so ReactiveWrappers is used from parts that need to be reactive-aware. Original Pull Request: #459
…Converters. Nullable wrappers such as Java 8 Optional, Guava Optional, Scala Option and Vavr Option are now handled in NullableWrapperConverters and are no longer coupled to QueryExecutionConverters so that this functionality can be reused. Original Pull Request: #459
We now support nullable wrappers for projection interfaces. Getters are inspected whether their return type is a supported nullable wrapper. If so, then the value can be wrapped into that type. Null values default in that case to their corresponding empty wrapper representation. Original Pull Request: #459
Original Pull Request: #459
Update JavaDoc, remove unused imports and reduce method visibility. Original Pull Request: #459
We now support nullable wrappers for projection interfaces. Getters are inspected whether their return type is a supported nullable wrapper. If so, then the value can be wrapped into that type. Null values default in that case to their corresponding empty wrapper representation.
Also, extracted
NullableWrapperConverters
fromQueryExecutionConverters
and removedReactiveWrappers
fromQueryExecutionConverters
.We should reconsider the package for
NullableWrapperConverters
as further extensions (Iterable -> Streamable
) might be future enhancements.Related ticket: DATACMNS-1762
Previous pull request: #457.