Comments (4)
Is that example really something we'd recommend people to do? Turning a List
into a Stream
i a default method replaces a single method call on the List
with an additional method declaration on the repository. Also, it doesn't really create any of the benefits you'd usually get when declaring a Stream
method on the repository (actually streaming the results).
from spring-data-examples.
I just wanted to highlight two different ways to use Java 8 Streams - the variant with the default method simply shows how easy it is to extend the existing API without having to call stream() on the result yourself - this makes for shorter examples and demonstrates another use of default methods.
from spring-data-examples.
To me it looks more like a "because you can" rather than something really useful. Would you really add three more lines and an additional repository method instead of just calling ….stream()
on the client? Especially if it doesn't really give you a Stream
but only a streaming view of the list? Why not declare an additional, really streaming method? You write less code and actually get the benefits of the new return type. IYAM, what we have in #62 is short, concise and practical.
from spring-data-examples.
Since we have native Stream
support, this issue is no longer valid.
from spring-data-examples.
Related Issues (20)
- @Query support any parser, for example. HOT 4
- Add transactions example for couchbase HOT 1
- couchbase transactions example needs to be on 3.0.0-RC2 as reactor in 3.0.0-SNAPSHOT introduced a regression HOT 1
- Additions to couchbase transactions example HOT 1
- The transaction does not seem to take effect in this case HOT 13
- Upgrade to Spring Boot 3.0.2
- Upgrade to Spring Boot 3.0 GA
- spring boot data jdbc 2.7.6 saveAll as batch insert HOT 1
- Upgrade to Spring Boot 3.1.0-RC1
- Update the Elasticsearch setup to the current version 8 of Elasticsearch. HOT 2
- Migrate Couchbase tests to JUnit 5
- Add examples using Virtual Threads
- Create an example for Schema Generation in Spring Data JDBC
- Upgrade to Spring Boot 3.2
- Add Kotlin value classes sample
- Update examples to demonstrate usage of Limit parameter.
- Connect to Huawei Cloud guassDB HOT 1
- Add Example for Multi Tenancy using Parent-Child relationship HOT 1
- Error when running jpa/envers: Illegal argument on static metamodel field injection HOT 2
- Add example of Kotlin Coroutine and Reactive MongoDB mixture HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-examples.