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 9ed0af87..e56d1770 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 @@ -130,9 +130,9 @@ public class SimpleReactiveCouchbaseRepository imple @SuppressWarnings("unchecked") @Override - public Mono findById(Mono mono) { - Assert.notNull(mono, "The given mono must not be null!"); - return mono.flatMap( + public Mono findById(Publisher publisher) { + Assert.notNull(publisher, "The given Publisher must not be null!"); + return Mono.from(publisher).flatMap( this::findById); } @@ -145,8 +145,9 @@ public class SimpleReactiveCouchbaseRepository imple @SuppressWarnings("unchecked") @Override - public Mono existsById(Mono mono) { - return mono.flatMap( + public Mono existsById(Publisher publisher) { + Assert.notNull(publisher, "The given Publisher must not be null!"); + return Mono.from(publisher).flatMap( this::existsById); } @@ -180,7 +181,7 @@ public class SimpleReactiveCouchbaseRepository imple public Flux findAllById(Publisher entityStream) { Assert.notNull(entityStream, "The given entityStream must not be null!"); return Flux.from(entityStream) - .flatMap(entity -> findById(entity)); + .flatMap(this::findById); } @SuppressWarnings("unchecked")