DATACOUCH-314 - Adopt to ReactiveCrudRepository.deleteById(Publisher).

Related ticket: DATACMNS-1063.

Original Pull Request: #147
This commit is contained in:
Christoph Strobl
2017-06-13 11:21:21 +02:00
parent 55832cfa21
commit 0786cda78d

View File

@@ -42,6 +42,7 @@ import reactor.core.publisher.Mono;
*
* @author Subhashni Balakrishnan
* @author Mark Paluch
* @author Christoph Strobl
* @since 3.0
*/
public class SimpleReactiveCouchbaseRepository<T, ID extends Serializable> implements ReactiveCouchbaseRepository<T, ID> {
@@ -191,6 +192,13 @@ public class SimpleReactiveCouchbaseRepository<T, ID extends Serializable> imple
return mapMono(operations.remove(id.toString()).map(res -> Observable.<Void>empty()).toSingle());
}
@Override
public Mono<Void> deleteById(Publisher<ID> publisher) {
Assert.notNull(publisher, "The given id must not be null!");
return Mono.from(publisher).flatMap(
this::deleteById);
}
@SuppressWarnings("unchecked")
@Override
public Mono<Void> delete(T entity) {