Class SimpleReactiveMongoRepository<T,ID extends Serializable>

java.lang.Object
org.springframework.data.mongodb.repository.support.SimpleReactiveMongoRepository<T,ID>
All Implemented Interfaces:
ReactiveMongoRepository<T,ID>, org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>, org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID>, org.springframework.data.repository.reactive.ReactiveSortingRepository<T,ID>, org.springframework.data.repository.Repository<T,ID>

public class SimpleReactiveMongoRepository<T,ID extends Serializable> extends Object implements ReactiveMongoRepository<T,ID>
Reactive repository base implementation for Mongo.
Since:
2.0
Author:
Mark Paluch, Oliver Gierke, Christoph Strobl, Ruben J Garcia, Jens Schauder, Clément Petit
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<Long>
     
    <S extends T>
    reactor.core.publisher.Mono<Long>
    count(org.springframework.data.domain.Example<S> example)
     
    reactor.core.publisher.Mono<Void>
    delete(T entity)
     
    reactor.core.publisher.Mono<Void>
     
    reactor.core.publisher.Mono<Void>
    deleteAll(Iterable<? extends T> entities)
     
    reactor.core.publisher.Mono<Void>
    deleteAll(org.reactivestreams.Publisher<? extends T> entityStream)
     
    reactor.core.publisher.Mono<Void>
    deleteAllById(Iterable<? extends ID> ids)
     
    reactor.core.publisher.Mono<Void>
     
    reactor.core.publisher.Mono<Void>
    deleteById(org.reactivestreams.Publisher<ID> publisher)
     
    <S extends T>
    reactor.core.publisher.Mono<Boolean>
    exists(org.springframework.data.domain.Example<S> example)
     
    reactor.core.publisher.Mono<Boolean>
     
    reactor.core.publisher.Mono<Boolean>
    existsById(org.reactivestreams.Publisher<ID> publisher)
     
    reactor.core.publisher.Flux<T>
     
    <S extends T>
    reactor.core.publisher.Flux<S>
    findAll(org.springframework.data.domain.Example<S> example)
    Returns all entities matching the given Example.
    <S extends T>
    reactor.core.publisher.Flux<S>
    findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort)
    Returns all entities matching the given Example applying the given Sort.
    reactor.core.publisher.Flux<T>
    findAll(org.springframework.data.domain.Sort sort)
     
    reactor.core.publisher.Flux<T>
     
    reactor.core.publisher.Flux<T>
    findAllById(org.reactivestreams.Publisher<ID> ids)
     
    <S extends T, R, P extends org.reactivestreams.Publisher<R>>
    P
    findBy(org.springframework.data.domain.Example<S> example, Function<org.springframework.data.repository.query.FluentQuery.ReactiveFluentQuery<S>,P> queryFunction)
     
    reactor.core.publisher.Mono<T>
     
    reactor.core.publisher.Mono<T>
    findById(org.reactivestreams.Publisher<ID> publisher)
     
    <S extends T>
    reactor.core.publisher.Mono<S>
    findOne(org.springframework.data.domain.Example<S> example)
     
    <S extends T>
    reactor.core.publisher.Flux<S>
    insert(Iterable<S> entities)
    Inserts the given entities.
    <S extends T>
    reactor.core.publisher.Flux<S>
    insert(org.reactivestreams.Publisher<S> entities)
    Inserts the given entities.
    <S extends T>
    reactor.core.publisher.Mono<S>
    insert(S entity)
    Inserts the given entity.
    <S extends T>
    reactor.core.publisher.Mono<S>
    save(S entity)
     
    <S extends T>
    reactor.core.publisher.Flux<S>
    saveAll(Iterable<S> entities)
     
    <S extends T>
    reactor.core.publisher.Flux<S>
    saveAll(org.reactivestreams.Publisher<S> entityStream)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • save

      public <S extends T> reactor.core.publisher.Mono<S> save(S entity)
      Specified by:
      save in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • saveAll

      public <S extends T> reactor.core.publisher.Flux<S> saveAll(Iterable<S> entities)
      Specified by:
      saveAll in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • saveAll

      public <S extends T> reactor.core.publisher.Flux<S> saveAll(org.reactivestreams.Publisher<S> entityStream)
      Specified by:
      saveAll in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • findById

      public reactor.core.publisher.Mono<T> findById(ID id)
      Specified by:
      findById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • findById

      public reactor.core.publisher.Mono<T> findById(org.reactivestreams.Publisher<ID> publisher)
      Specified by:
      findById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • existsById

      public reactor.core.publisher.Mono<Boolean> existsById(ID id)
      Specified by:
      existsById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • existsById

      public reactor.core.publisher.Mono<Boolean> existsById(org.reactivestreams.Publisher<ID> publisher)
      Specified by:
      existsById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • findAll

      public reactor.core.publisher.Flux<T> findAll()
      Specified by:
      findAll in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • findAllById

      public reactor.core.publisher.Flux<T> findAllById(Iterable<ID> ids)
      Specified by:
      findAllById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • findAllById

      public reactor.core.publisher.Flux<T> findAllById(org.reactivestreams.Publisher<ID> ids)
      Specified by:
      findAllById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • count

      public reactor.core.publisher.Mono<Long> count()
      Specified by:
      count in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • deleteById

      public reactor.core.publisher.Mono<Void> deleteById(ID id)
      Specified by:
      deleteById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • deleteById

      public reactor.core.publisher.Mono<Void> deleteById(org.reactivestreams.Publisher<ID> publisher)
      Specified by:
      deleteById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • delete

      public reactor.core.publisher.Mono<Void> delete(T entity)
      Specified by:
      delete in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • deleteAllById

      public reactor.core.publisher.Mono<Void> deleteAllById(Iterable<? extends ID> ids)
      Specified by:
      deleteAllById in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • deleteAll

      public reactor.core.publisher.Mono<Void> deleteAll(Iterable<? extends T> entities)
      Specified by:
      deleteAll in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • deleteAll

      public reactor.core.publisher.Mono<Void> deleteAll(org.reactivestreams.Publisher<? extends T> entityStream)
      Specified by:
      deleteAll in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • deleteAll

      public reactor.core.publisher.Mono<Void> deleteAll()
      Specified by:
      deleteAll in interface org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
    • findAll

      public reactor.core.publisher.Flux<T> findAll(org.springframework.data.domain.Sort sort)
      Specified by:
      findAll in interface org.springframework.data.repository.reactive.ReactiveSortingRepository<T,ID extends Serializable>
    • insert

      public <S extends T> reactor.core.publisher.Mono<S> insert(S entity)
      Description copied from interface: ReactiveMongoRepository
      Inserts the given entity. Assumes the instance to be new to be able to apply insertion optimizations. Use the returned instance for further operations as the save operation might have changed the entity instance completely. Prefer using ReactiveCrudRepository.save(Object) instead to avoid the usage of store-specific API.
      Specified by:
      insert in interface ReactiveMongoRepository<T,ID extends Serializable>
      Parameters:
      entity - must not be null.
      Returns:
      the saved entity
    • insert

      public <S extends T> reactor.core.publisher.Flux<S> insert(Iterable<S> entities)
      Description copied from interface: ReactiveMongoRepository
      Inserts the given entities. Assumes the instance to be new to be able to apply insertion optimizations. Use the returned instance for further operations as the save operation might have changed the entity instance completely. Prefer using ReactiveCrudRepository.save(Object) instead to avoid the usage of store-specific API.
      Specified by:
      insert in interface ReactiveMongoRepository<T,ID extends Serializable>
      Parameters:
      entities - must not be null.
      Returns:
      the saved entity
    • insert

      public <S extends T> reactor.core.publisher.Flux<S> insert(org.reactivestreams.Publisher<S> entities)
      Description copied from interface: ReactiveMongoRepository
      Inserts the given entities. Assumes the instance to be new to be able to apply insertion optimizations. Use the returned instance for further operations as the save operation might have changed the entity instance completely. Prefer using ReactiveCrudRepository.save(Object) instead to avoid the usage of store-specific API.
      Specified by:
      insert in interface ReactiveMongoRepository<T,ID extends Serializable>
      Parameters:
      entities - must not be null.
      Returns:
      the saved entity
    • findOne

      public <S extends T> reactor.core.publisher.Mono<S> findOne(org.springframework.data.domain.Example<S> example)
      Specified by:
      findOne in interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
    • findAll

      public <S extends T> reactor.core.publisher.Flux<S> findAll(org.springframework.data.domain.Example<S> example)
      Description copied from interface: ReactiveMongoRepository
      Returns all entities matching the given Example. In case no match could be found an empty Flux is returned.
      By default the Example uses typed matching restricting it to probe assignable types. For example, when sticking with the default type key (_class), the query has restrictions such as _class : { $in : [com.acme.Person] }.
      To avoid the above mentioned type restriction use an UntypedExampleMatcher with Example.of(Object, org.springframework.data.domain.ExampleMatcher).
      Specified by:
      findAll in interface ReactiveMongoRepository<T,ID extends Serializable>
      Specified by:
      findAll in interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
      See Also:
      • ReactiveQueryByExampleExecutor.findAll(org.springframework.data.domain.Example)
    • findAll

      public <S extends T> reactor.core.publisher.Flux<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort)
      Description copied from interface: ReactiveMongoRepository
      Returns all entities matching the given Example applying the given Sort. In case no match could be found an empty Flux is returned.
      By default the Example uses typed matching restricting it to probe assignable types. For example, when sticking with the default type key (_class), the query has restrictions such as _class : { $in : [com.acme.Person] }.
      To avoid the above mentioned type restriction use an UntypedExampleMatcher with Example.of(Object, org.springframework.data.domain.ExampleMatcher).
      Specified by:
      findAll in interface ReactiveMongoRepository<T,ID extends Serializable>
      Specified by:
      findAll in interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
      See Also:
      • ReactiveQueryByExampleExecutor.findAll(org.springframework.data.domain.Example, org.springframework.data.domain.Sort)
    • count

      public <S extends T> reactor.core.publisher.Mono<Long> count(org.springframework.data.domain.Example<S> example)
      Specified by:
      count in interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
    • exists

      public <S extends T> reactor.core.publisher.Mono<Boolean> exists(org.springframework.data.domain.Example<S> example)
      Specified by:
      exists in interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
    • findBy

      public <S extends T, R, P extends org.reactivestreams.Publisher<R>> P findBy(org.springframework.data.domain.Example<S> example, Function<org.springframework.data.repository.query.FluentQuery.ReactiveFluentQuery<S>,P> queryFunction)
      Specified by:
      findBy in interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>