This is already supported in Spring JPA data, see here ; therefore there is no real advantage to overriding those that return Stream. If you really want Streamsome of the potential benefits that come with it, use what Spring Data JPA already provides.
And another aspect is that JPA Spec 2.2it may be the default return type of some queries. Interfaces JPA Queryand TypedQueryreceive a new method called getResultStream().
So Spring Data will use provider-specific methods, such as Hibernateor EclipseLinkto stream the result.
getResultStream - list.stream, Hibernate ScrollableResult. , .