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
ConstructorDescriptionSimpleReactiveMongoRepository
(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:
save
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
saveAll
- Specified by:
saveAll
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
saveAll
public <S extends T> reactor.core.publisher.Flux<S> saveAll(org.reactivestreams.Publisher<S> entityStream) - Specified by:
saveAll
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
findById
- Specified by:
findById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
findById
- Specified by:
findById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
existsById
- Specified by:
existsById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
existsById
- Specified by:
existsById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
findAll
- Specified by:
findAll
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
findAllById
- Specified by:
findAllById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
findAllById
- Specified by:
findAllById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
count
- Specified by:
count
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
deleteById
- Specified by:
deleteById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
deleteById
- Specified by:
deleteById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
delete
- Specified by:
delete
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
deleteAllById
- Specified by:
deleteAllById
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
deleteAll
- Specified by:
deleteAll
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
deleteAll
public reactor.core.publisher.Mono<Void> deleteAll(org.reactivestreams.Publisher<? extends T> entityStream) - Specified by:
deleteAll
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
deleteAll
- Specified by:
deleteAll
in interfaceReactiveCrudRepository<T,
ID extends Serializable>
-
findAll
- Specified by:
findAll
in interfaceReactiveSortingRepository<T,
ID extends Serializable>
-
insert
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 usingReactiveCrudRepository.save(Object)
instead to avoid the usage of store-specific API.- Specified by:
insert
in interfaceReactiveMongoRepository<T,
ID extends Serializable> - Parameters:
entity
- must not be null.- Returns:
- the saved entity
-
insert
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 usingReactiveCrudRepository.save(Object)
instead to avoid the usage of store-specific API.- Specified by:
insert
in 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: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 usingReactiveCrudRepository.save(Object)
instead to avoid the usage of store-specific API.- Specified by:
insert
in interfaceReactiveMongoRepository<T,
ID extends Serializable> - Parameters:
entities
- must not be null.- Returns:
- the saved entity
-
findOne
- Specified by:
findOne
in interfaceReactiveQueryByExampleExecutor<T>
-
findAll
Description copied from interface:ReactiveMongoRepository
Returns all entities matching the givenExample
. In case no match could be found an emptyFlux
is returned.
By default theExample
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 anUntypedExampleMatcher
withExample.of(Object, org.springframework.data.domain.ExampleMatcher)
.- Specified by:
findAll
in interfaceReactiveMongoRepository<T,
ID extends Serializable> - Specified by:
findAll
in interfaceReactiveQueryByExampleExecutor<T>
- See Also:
-
findAll
Description copied from interface:ReactiveMongoRepository
Returns all entities matching the givenExample
applying the givenSort
. In case no match could be found an emptyFlux
is returned.
By default theExample
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 anUntypedExampleMatcher
withExample.of(Object, org.springframework.data.domain.ExampleMatcher)
.- Specified by:
findAll
in interfaceReactiveMongoRepository<T,
ID extends Serializable> - Specified by:
findAll
in interfaceReactiveQueryByExampleExecutor<T>
- See Also:
-
count
- Specified by:
count
in interfaceReactiveQueryByExampleExecutor<T>
-
exists
- Specified by:
exists
in 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:
findBy
in interfaceReactiveQueryByExampleExecutor<T>
-