Skip to content

Commit 893149d

Browse files
committed
#2 - Fix DefaultTypedInsertSpec.then().
1 parent e8d3e05 commit 893149d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/org/springframework/data/jdbc/core/function/DefaultDatabaseClient.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ public InsertSpec using(Publisher<T> objectToInsert) {
933933

934934
@Override
935935
public Mono<Void> then() {
936-
return Mono.from(objectToInsert).map(toInsert -> exchange(toInsert, (row, md) -> row).all()).then();
936+
return Mono.from(objectToInsert).flatMapMany(toInsert -> exchange(toInsert, (row, md) -> row).all()).then();
937937
}
938938

939939
@Override
@@ -977,8 +977,9 @@ private <R> SqlResult<R> exchange(Object toInsert, BiFunction<Row, RowMetadata,
977977
return statement;
978978
};
979979

980-
Function<Connection, Flux<Result>> resultFunction = it -> Flux
981-
.from(insertFunction.apply(it).executeReturningGeneratedKeys());
980+
Function<Connection, Flux<Result>> resultFunction = it -> {
981+
return Flux.from(insertFunction.apply(it).executeReturningGeneratedKeys());
982+
};
982983

983984
return new DefaultSqlResult<>(DefaultDatabaseClient.this, //
984985
sql, //

0 commit comments

Comments
 (0)