5252import org .springframework .data .relational .core .mapping .event .*;
5353import org .springframework .data .relational .core .query .Query ;
5454import org .springframework .data .support .PageableExecutionUtils ;
55+ import org .springframework .data .util .Streamable ;
5556import org .springframework .lang .Nullable ;
5657import org .springframework .util .Assert ;
5758import org .springframework .util .ClassUtils ;
@@ -171,7 +172,7 @@ public <T> T save(T instance) {
171172 }
172173
173174 @ Override
174- public <T > Iterable <T > saveAll (Iterable <T > instances ) {
175+ public <T > List <T > saveAll (Iterable <T > instances ) {
175176
176177 Assert .notNull (instances , "Aggregate instances must not be null" );
177178
@@ -204,7 +205,7 @@ public <T> T insert(T instance) {
204205 }
205206
206207 @ Override
207- public <T > Iterable <T > insertAll (Iterable <T > instances ) {
208+ public <T > List <T > insertAll (Iterable <T > instances ) {
208209
209210 Assert .notNull (instances , "Aggregate instances must not be null" );
210211
@@ -239,7 +240,7 @@ public <T> T update(T instance) {
239240 }
240241
241242 @ Override
242- public <T > Iterable <T > updateAll (Iterable <T > instances ) {
243+ public <T > List <T > updateAll (Iterable <T > instances ) {
243244
244245 Assert .notNull (instances , "Aggregate instances must not be null" );
245246
@@ -298,7 +299,7 @@ public <T> T findById(Object id, Class<T> domainType) {
298299 }
299300
300301 @ Override
301- public <T > Iterable <T > findAll (Class <T > domainType , Sort sort ) {
302+ public <T > List <T > findAll (Class <T > domainType , Sort sort ) {
302303
303304 Assert .notNull (domainType , "Domain type must not be null" );
304305
@@ -323,8 +324,13 @@ public <T> Optional<T> findOne(Query query, Class<T> domainType) {
323324 }
324325
325326 @ Override
326- public <T > Iterable <T > findAll (Query query , Class <T > domainType ) {
327- return accessStrategy .findAll (query , domainType );
327+ public <T > List <T > findAll (Query query , Class <T > domainType ) {
328+
329+ Iterable <T > all = accessStrategy .findAll (query , domainType );
330+ if (all instanceof List <T > list ) {
331+ return list ;
332+ }
333+ return Streamable .of (all ).toList ();
328334 }
329335
330336 @ Override
@@ -337,7 +343,7 @@ public <T> Page<T> findAll(Query query, Class<T> domainType, Pageable pageable)
337343 }
338344
339345 @ Override
340- public <T > Iterable <T > findAll (Class <T > domainType ) {
346+ public <T > List <T > findAll (Class <T > domainType ) {
341347
342348 Assert .notNull (domainType , "Domain type must not be null" );
343349
@@ -346,7 +352,7 @@ public <T> Iterable<T> findAll(Class<T> domainType) {
346352 }
347353
348354 @ Override
349- public <T > Iterable <T > findAllById (Iterable <?> ids , Class <T > domainType ) {
355+ public <T > List <T > findAllById (Iterable <?> ids , Class <T > domainType ) {
350356
351357 Assert .notNull (ids , "Ids must not be null" );
352358 Assert .notNull (domainType , "Domain type must not be null" );
@@ -607,7 +613,7 @@ private MutableAggregateChange<?> createDeletingChange(Class<?> domainType) {
607613 return aggregateChange ;
608614 }
609615
610- private <T > Iterable <T > triggerAfterConvert (Iterable <T > all ) {
616+ private <T > List <T > triggerAfterConvert (Iterable <T > all ) {
611617
612618 List <T > result = new ArrayList <>();
613619
0 commit comments