Module spring.data.mongodb
Class SimpleReactiveMongoRepository<T,ID extends Serializable>
java.lang.Object
org.springframework.data.mongodb.repository.support.SimpleReactiveMongoRepository<T,ID>
- All Implemented Interfaces:
ReactiveMongoRepository<T,,ID> ReactiveQueryByExampleExecutor<T>,ReactiveCrudRepository<T,,ID> ReactiveSortingRepository<T,,ID> 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()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) 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>Returns all entities matching the givenExample.<S extends T>
reactor.core.publisher.Flux<S>reactor.core.publisher.Flux<T>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(Example<S> example, Function<FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) reactor.core.publisher.Mono<T>reactor.core.publisher.Mono<T><S extends T>
reactor.core.publisher.Mono<S><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) - Parameters:
entityInformation- must not be null.mongoOperations- must not be null.
-
-
Method Details
-
save
- Specified by:
savein interfaceReactiveCrudRepository<T,ID extends Serializable>
-
saveAll
- Specified by:
saveAllin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
saveAll
public <S extends T> reactor.core.publisher.Flux<S> saveAll(org.reactivestreams.Publisher<S> entityStream) - Specified by:
saveAllin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
findById
- Specified by:
findByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
findById
- Specified by:
findByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
existsById
- Specified by:
existsByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
existsById
- Specified by:
existsByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
findAll
- Specified by:
findAllin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
findAllById
- Specified by:
findAllByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
findAllById
- Specified by:
findAllByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
count
- Specified by:
countin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
deleteById
- Specified by:
deleteByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
deleteById
- Specified by:
deleteByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
delete
- Specified by:
deletein interfaceReactiveCrudRepository<T,ID extends Serializable>
-
deleteAllById
- Specified by:
deleteAllByIdin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
deleteAll
- Specified by:
deleteAllin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
deleteAll
public reactor.core.publisher.Mono<Void> deleteAll(org.reactivestreams.Publisher<? extends T> entityStream) - Specified by:
deleteAllin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
deleteAll
- Specified by:
deleteAllin interfaceReactiveCrudRepository<T,ID extends Serializable>
-
findAll
- Specified by:
findAllin interfaceReactiveSortingRepository<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
- Specified by:
findOnein interfaceReactiveQueryByExampleExecutor<T>
-
findAll
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 interfaceReactiveQueryByExampleExecutor<T>- See Also:
-
findAll
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 interfaceReactiveQueryByExampleExecutor<T>- See Also:
-
count
- Specified by:
countin interfaceReactiveQueryByExampleExecutor<T>
-
exists
- Specified by:
existsin interfaceReactiveQueryByExampleExecutor<T>
-
findBy
public <S extends T,R, P findByP extends org.reactivestreams.Publisher<R>> (Example<S> example, Function<FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) - Specified by:
findByin interfaceReactiveQueryByExampleExecutor<T>
-