From 0786cda78df3a90042bab5802a481833df654578 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Tue, 13 Jun 2017 11:21:21 +0200 Subject: [PATCH] DATACOUCH-314 - Adopt to ReactiveCrudRepository.deleteById(Publisher). Related ticket: DATACMNS-1063. Original Pull Request: #147 --- .../support/SimpleReactiveCouchbaseRepository.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java b/src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java index e56d1770..47100892 100644 --- a/src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java +++ b/src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java @@ -42,6 +42,7 @@ import reactor.core.publisher.Mono; * * @author Subhashni Balakrishnan * @author Mark Paluch + * @author Christoph Strobl * @since 3.0 */ public class SimpleReactiveCouchbaseRepository implements ReactiveCouchbaseRepository { @@ -191,6 +192,13 @@ public class SimpleReactiveCouchbaseRepository imple return mapMono(operations.remove(id.toString()).map(res -> Observable.empty()).toSingle()); } + @Override + public Mono deleteById(Publisher publisher) { + Assert.notNull(publisher, "The given id must not be null!"); + return Mono.from(publisher).flatMap( + this::deleteById); + } + @SuppressWarnings("unchecked") @Override public Mono delete(T entity) {