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
Javaslang collections cannot be returned from paginating query methods [DATACMNS-1005] #1455
Comments
Oliver Drotbohm commented Looks like our assertions for paginating query methods have to be updated |
Maciek Opała commented I'm keen on preparing a PR that will fix this issue, however would like to discuss it before. I guess it might not be enough to add JavaSlang types to the following piece of code (taken from if(!this.isStreamQuery()) {
ClassUtils.assertReturnTypeAssignable(method, new Class[]{Slice.class, Page.class, List.class});
} ? |
Daniel Dietrich commented You may want to check if the returned collection is of type javaslang.collection.Seq. It is the most general interface for sequential collections like List and Vector |
Oliver Drotbohm commented Unfortunately it's not as simple as that'd introduce a strong dependency to Javaslang which we can't introduce as it currently is (and very probably will stay) an optional dependency. Nonetheless, should be fixable by introducing a dedicated method to return all supported types from |
Maciek Opała commented So, I will introduce |
Oliver Drotbohm commented Sounds like a plan! :) |
Maciek Opała commented I've started with creating a test (here) which I presume describes the expected behaviour well. The problem is that If |
Oliver Drotbohm commented I guess we have to change You know what, I'd prefer that new method to live inside |
Maciek Opała commented I've implemented the solution using the clues you provided, please have a look here if this is what you expected. It it's ok I'll issue a PR at once |
Oliver Drotbohm commented We can't have a strong type reference to Feel free to open the PR. It's easier to have implementation discussions right there |
Maciek Opała commented Here you go: #200 |
Oliver Drotbohm commented Thanks, Maciek, I'll take it from here |
Oliver Drotbohm commented That's polished and merged. Thanks for your contribution, Maciek! |
Maciek Opała opened DATACMNS-1005 and commented
With the release of Ingalls, JavaSlang types (collections and Option) can be returned directly from spring-data
@Repository
- annotated components. Unfortunately, it turns out that if a in-@Repository
-defined method has an argument of type @Pageable application fails at startup because of the following exception:The following piece of code illustrates the problem:
Affects: 1.13.1 (Ingalls SR1)
Referenced from: pull request #200
Backported to: 1.13.2 (Ingalls SR2)
The text was updated successfully, but these errors were encountered: