Skip to content
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

#60 - Add example for Java 8 Streams via default method in JPA. #61

Closed
wants to merge 5 commits into from

Conversation

thomasdarimont
Copy link
Contributor

Outlines the use of Stream as simple wrapper around actual finder method result with a default method.

Thomas Darimont and others added 5 commits March 3, 2015 23:19
This initial version of the example projects demonstrates the usage and mapping behavior of Java 8 Streams in repositories. The test cases oppose a plain List based query method with one that uses a Stream and shows how the former pulls all data into memory first and the iteration is done over the pre-populated list. The execution of the Stream based method in contrast shows that the individual elements are read and converted while iterating the stream.
Tweaked the integration test to use the Stream returned by the repository within a try-with-resources clause so that it gets closed correctly.
Outlines the use of Stream as simple wrapper around actual finder method result with a default method.
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.

None yet

2 participants