Skip to content

Commit 92e77a4

Browse files
committed
Retain element ordering in AfterConvertCallbacks.
We now use concatMap on result Fluxes to retain the object order. Previously, we used flatMap on a flux that has led to changes in element ordering. Closes #1307
1 parent e246cc4 commit 92e77a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ <T, P extends Publisher<T>> P doSelect(Query query, Class<?> entityClass, SqlIde
380380
return (P) ((Mono<?>) result).flatMap(it -> maybeCallAfterConvert(it, tableName));
381381
}
382382

383-
return (P) ((Flux<?>) result).flatMap(it -> maybeCallAfterConvert(it, tableName));
383+
return (P) ((Flux<?>) result).concatMap(it -> maybeCallAfterConvert(it, tableName));
384384
}
385385

386386
private <T> RowsFetchSpec<T> doSelect(Query query, Class<?> entityClass, SqlIdentifier tableName,
@@ -942,7 +942,7 @@ public Mono<T> first() {
942942

943943
@Override
944944
public Flux<T> all() {
945-
return delegate.all().flatMap(it -> maybeCallAfterConvert(it, tableName));
945+
return delegate.all().concatMap(it -> maybeCallAfterConvert(it, tableName));
946946
}
947947
}
948948

0 commit comments

Comments
 (0)