Skip to content

changed return type of findAll methods in QueryDslPredicateExecutor to List #143

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 1 commit into from
Closed

changed return type of findAll methods in QueryDslPredicateExecutor to List #143

wants to merge 1 commit into from

Conversation

lpandzic
Copy link

No description provided.

@odrotbohm
Copy link
Member

What's the reasoning behind this change? We can't simply change return types as this will inevitably break implementations. Also Iterable was used by design to allow for implementations that are not List based in the first place.

@lpandzic
Copy link
Author

Main issue with Iterable is it's API which is really lacking compared to Collection or List API.

For instance, to convert List to a Stream all you have to do is call #stream available from Collection interface. On the other hand, converting Iterable to a Stream is not so simple: StreamSupport.stream(iterable.spliterator(), false).

Also, API of Repositories is not consistent when we take JPARepository into account.
As an alternative to this PR, would it be more acceptable to provide a specialized JPAQueryDslPredicateExecutor which overrides those methods with specialized return type? QueryDslJpaRepository already has List as it's return type for those methods.

@pivotal-issuemaster
Copy link

@lpandzic Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@lpandzic
Copy link
Author

Since https://jira.spring.io/browse/DATACMNS-867 will solve the issue of converting to Stream, I'm closing this pull request.

@lpandzic lpandzic closed this Jan 18, 2017
Aloren pushed a commit to Aloren/spring-data-commons that referenced this pull request Jun 20, 2019
Aloren pushed a commit to Aloren/spring-data-commons that referenced this pull request Jun 20, 2019
Aloren pushed a commit to Aloren/spring-data-commons that referenced this pull request Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants