Skip to content

Commit 2f5d11b

Browse files
committed
#90 - Polishing.
Original pull request: #90.
1 parent cca38b4 commit 2f5d11b

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/main/java/org/springframework/data/r2dbc/repository/support/SimpleR2dbcRepository.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ public <S extends T> Mono<S> save(S objectToSave) {
8888
GenericExecuteSpec exec = databaseClient.execute().sql(update);
8989

9090
BindSpecAdapter<GenericExecuteSpec> wrapper = BindSpecAdapter.create(exec);
91-
columns.forEach((k, v) -> {
92-
update.bind(wrapper, k, v);
93-
94-
});
91+
columns.forEach((k, v) -> update.bind(wrapper, k, v));
9592
update.bindId(wrapper, id);
9693

9794
return wrapper.getBoundOperation().as(entity.getJavaType()) //

src/test/java/org/springframework/data/r2dbc/repository/AbstractR2dbcRepositoryIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,16 @@ public void shouldInsertItemsTransactional() {
188188
Flux<Map<String, Object>> transactional = client.inTransaction(db -> {
189189

190190
return transactionalRepository.save(legoSet1) //
191-
.map(it -> jdbc.queryForMap("SELECT count(*) as count FROM legoset"));
191+
.map(it -> jdbc.queryForMap("SELECT count(*) AS count FROM legoset"));
192192
});
193193

194194
Mono<Map<String, Object>> nonTransactional = transactionalRepository.save(legoSet2) //
195-
.map(it -> jdbc.queryForMap("SELECT count(*) as count FROM legoset"));
195+
.map(it -> jdbc.queryForMap("SELECT count(*) AS count FROM legoset"));
196196

197197
transactional.as(StepVerifier::create).expectNext(Collections.singletonMap("count", 0L)).verifyComplete();
198198
nonTransactional.as(StepVerifier::create).expectNext(Collections.singletonMap("count", 2L)).verifyComplete();
199199

200-
Map<String, Object> count = jdbc.queryForMap("SELECT count(*) as count FROM legoset");
200+
Map<String, Object> count = jdbc.queryForMap("SELECT count(*) AS count FROM legoset");
201201
assertThat(count).containsEntry("count", 2L);
202202
}
203203

src/test/java/org/springframework/data/r2dbc/repository/support/H2SimpleR2dbcRepositoryIntegrationTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,9 @@ public void shouldInsertNewObjectWithGivenId() {
7575

7676
repository.save(legoSet) //
7777
.as(StepVerifier::create) //
78-
.consumeNextWith(actual -> {
79-
80-
assertThat(actual.getId()).isEqualTo(9999);
81-
}).verifyComplete();
78+
.consumeNextWith( //
79+
actual -> assertThat(actual.getId()).isEqualTo(9999) //
80+
).verifyComplete();
8281

8382
Map<String, Object> map = jdbc.queryForMap("SELECT * FROM legoset");
8483
assertThat(map).containsEntry("name", "SCHAUFELRADBAGGER").containsEntry("manual", 12).containsKey("id");

0 commit comments

Comments
 (0)