Skip to content

Commit dd2d94e

Browse files
committed
Retain element ordering in entity callbacks.
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 #777
1 parent 39216db commit dd2d94e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

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

412-
return (P) ((Flux<?>) result).flatMap(it -> maybeCallAfterConvert(it, tableName));
412+
return (P) ((Flux<?>) result).concatMap(it -> maybeCallAfterConvert(it, tableName));
413413
}
414414

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

11151115
@Override
11161116
public Flux<T> all() {
1117-
return delegate.all().flatMap(it -> maybeCallAfterConvert(it, tableName));
1117+
return delegate.all().concatMap(it -> maybeCallAfterConvert(it, tableName));
11181118
}
11191119
}
11201120

0 commit comments

Comments
 (0)