Cannot find stream method
FabioFriz opened this issue · 4 comments
FabioFriz commented
Hi,
I had some problems with stream method, so I had to substitute each call like repository.findAll().stream()
with StreamSupport.stream(repository.findAll().spliterator(), false)
.
gregturn commented
The first thing that comes to mind is, are you using Java 8+, or Java 7. Because the stream()
method being added to java.util.Collection
(parent interface of java.util.List
) isn't until JDK 8.
FabioFriz commented
It's the same thing I thought of, but I'm using Java 11.0.2
zain1612 commented
https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/repository/CrudRepository.html
returns a Iterableon findAll. Greg perhaps update the tutorial?