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
ConstructorsConstructorDescriptionSimpleReactiveMongoRepository(MongoEntityInformation<T, ID> entityInformation, ReactiveMongoOperations mongoOperations) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Long>count()count(org.springframework.data.domain.Example<S> example) reactor.core.publisher.Mono<Void>reactor.core.publisher.Mono<Void>reactor.core.publisher.Mono<Void>reactor.core.publisher.Mono<Void>reactor.core.publisher.Mono<Void>deleteAllById(Iterable<? extends ID> ids) reactor.core.publisher.Mono<Void>deleteById(ID id) reactor.core.publisher.Mono<Void>deleteById(org.reactivestreams.Publisher<ID> publisher) exists(org.springframework.data.domain.Example<S> example) reactor.core.publisher.Mono<Boolean>existsById(ID id) reactor.core.publisher.Mono<Boolean>existsById(org.reactivestreams.Publisher<ID> publisher) reactor.core.publisher.Flux<T>findAll()<S extends T>
reactor.core.publisher.Flux<S>findAll(org.springframework.data.domain.Example<S> example) Returns all entities matching the givenExample.<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 givenExampleapplying the givenSort.reactor.core.publisher.Flux<T>findAll(org.springframework.data.domain.Sort sort) reactor.core.publisher.Flux<T>findAllById(Iterable<ID> ids) reactor.core.publisher.Flux<T>findAllById(org.reactivestreams.Publisher<ID> ids) <S extends T,R, P extends org.reactivestreams.Publisher<R>>
PfindBy(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><S extends T>
reactor.core.publisher.Mono<S>findOne(org.springframework.data.domain.Example<S> example) <S extends T>
reactor.core.publisher.Flux<S>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><S extends T>
reactor.core.publisher.Flux<S>saveAll(org.reactivestreams.Publisher<S> entityStream)
-
Constructor Details
-
SimpleReactiveMongoRepository
public SimpleReactiveMongoRepository(MongoEntityInformation<T, ID> entityInformation, ReactiveMongoOperations mongoOperations)
-
-
Method Details
-
save
- Specified by:
savein interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
saveAll
- Specified by:
saveAllin interfaceorg.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:
saveAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
findById
- Specified by:
findByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
findById
- Specified by:
findByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
existsById
- Specified by:
existsByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
existsById
- Specified by:
existsByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
findAll
- Specified by:
findAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
findAllById
- Specified by:
findAllByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
findAllById
- Specified by:
findAllByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
count
- Specified by:
countin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
deleteById
- Specified by:
deleteByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
deleteById
- Specified by:
deleteByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
delete
- Specified by:
deletein interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
deleteAllById
- Specified by:
deleteAllByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
deleteAll
- Specified by:
deleteAllin interfaceorg.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:
deleteAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
deleteAll
- Specified by:
deleteAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID extends Serializable>
-
findAll
- Specified by:
findAllin interfaceorg.springframework.data.repository.reactive.ReactiveSortingRepository<T,ID extends Serializable>
-
insert
Description copied from interface:ReactiveMongoRepositoryInserts 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 usingReactiveCrudRepository.save(Object)instead to avoid the usage of store-specific API.- Specified by:
insertin interfaceReactiveMongoRepository<T,ID extends Serializable> - Parameters:
entity- must not be null.- Returns:
- the saved entity
-
insert
Description copied from interface:ReactiveMongoRepositoryInserts 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 usingReactiveCrudRepository.save(Object)instead to avoid the usage of store-specific API.- Specified by:
insertin interfaceReactiveMongoRepository<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:ReactiveMongoRepositoryInserts 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 usingReactiveCrudRepository.save(Object)instead to avoid the usage of store-specific API.- Specified by:
insertin interfaceReactiveMongoRepository<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:
findOnein interfaceorg.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:ReactiveMongoRepositoryReturns all entities matching the givenExample. In case no match could be found an emptyFluxis returned.
By default theExampleuses 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 anUntypedExampleMatcherwithExample.of(Object, org.springframework.data.domain.ExampleMatcher).- Specified by:
findAllin interfaceReactiveMongoRepository<T,ID extends Serializable> - Specified by:
findAllin interfaceorg.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:ReactiveMongoRepositoryReturns all entities matching the givenExampleapplying the givenSort. In case no match could be found an emptyFluxis returned.
By default theExampleuses 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 anUntypedExampleMatcherwithExample.of(Object, org.springframework.data.domain.ExampleMatcher).- Specified by:
findAllin interfaceReactiveMongoRepository<T,ID extends Serializable> - Specified by:
findAllin interfaceorg.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:
countin interfaceorg.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:
existsin interfaceorg.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
-
findBy
public <S extends T,R, P findByP extends org.reactivestreams.Publisher<R>> (org.springframework.data.domain.Example<S> example, Function<org.springframework.data.repository.query.FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) - Specified by:
findByin interfaceorg.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
-