Class SimpleReactiveCosmosRepository<T,K extends Serializable>
- java.lang.Object
-
- com.azure.spring.data.cosmos.repository.support.SimpleReactiveCosmosRepository<T,K>
-
- All Implemented Interfaces:
ReactiveCosmosRepository<T,K>,org.springframework.data.repository.reactive.ReactiveCrudRepository<T,K>,org.springframework.data.repository.reactive.ReactiveSortingRepository<T,K>,org.springframework.data.repository.Repository<T,K>
public class SimpleReactiveCosmosRepository<T,K extends Serializable> extends Object implements ReactiveCosmosRepository<T,K>
Repository class for simple reactive Cosmos operation
-
-
Constructor Summary
Constructors Constructor Description SimpleReactiveCosmosRepository(CosmosEntityInformation<T,K> metadata, ReactiveCosmosOperations reactiveCosmosOperations)Initialization with metadata and reactiveCosmosOperations
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Long>count()Mono<Void>delete(T entity)Mono<Void>deleteAll()Mono<Void>deleteAll(Iterable<? extends T> entities)Mono<Void>deleteAll(org.reactivestreams.Publisher<? extends T> entityStream)Mono<Void>deleteAllById(Iterable<? extends K> ids)Mono<Void>deleteById(K id)Mono<Void>deleteById(K id, PartitionKey partitionKey)Deletes an entity by its id and partition key.Mono<Void>deleteById(org.reactivestreams.Publisher<K> publisher)Mono<Boolean>existsById(K id)Mono<Boolean>existsById(org.reactivestreams.Publisher<K> publisher)Flux<T>findAll()Flux<T>findAll(PartitionKey partitionKey)Returns Flux of items in a specific partitionFlux<T>findAll(org.springframework.data.domain.Sort sort)Flux<T>findAllById(Iterable<K> ids)Flux<T>findAllById(org.reactivestreams.Publisher<K> ids)Mono<T>findById(K id)Mono<T>findById(K id, PartitionKey partitionKey)Retrieves an entity by its id and partition key.Mono<T>findById(org.reactivestreams.Publisher<K> publisher)<S extends T>
Mono<S>save(S entity)<S extends T>
Flux<S>saveAll(Iterable<S> entities)<S extends T>
Flux<S>saveAll(org.reactivestreams.Publisher<S> entityStream)
-
-
-
Constructor Detail
-
SimpleReactiveCosmosRepository
public SimpleReactiveCosmosRepository(CosmosEntityInformation<T,K> metadata, ReactiveCosmosOperations reactiveCosmosOperations)
Initialization with metadata and reactiveCosmosOperations- Parameters:
metadata- for entityInformationreactiveCosmosOperations- for cosmosOperations
-
-
Method Detail
-
findAll
public Flux<T> findAll(org.springframework.data.domain.Sort sort)
- Specified by:
findAllin interfaceorg.springframework.data.repository.reactive.ReactiveSortingRepository<T,K extends Serializable>
-
findAll
public Flux<T> findAll(PartitionKey partitionKey)
Description copied from interface:ReactiveCosmosRepositoryReturns Flux of items in a specific partition- Specified by:
findAllin interfaceReactiveCosmosRepository<T,K extends Serializable>- Parameters:
partitionKey- partition key value- Returns:
Fluxof items with partition key value
-
save
public <S extends T> Mono<S> save(S entity)
- Specified by:
savein interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
saveAll
public <S extends T> Flux<S> saveAll(Iterable<S> entities)
- Specified by:
saveAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
saveAll
public <S extends T> Flux<S> saveAll(org.reactivestreams.Publisher<S> entityStream)
- Specified by:
saveAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
findById
public Mono<T> findById(K id)
- Specified by:
findByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
findById
public Mono<T> findById(org.reactivestreams.Publisher<K> publisher)
- Specified by:
findByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
findById
public Mono<T> findById(K id, PartitionKey partitionKey)
Description copied from interface:ReactiveCosmosRepositoryRetrieves an entity by its id and partition key.- Specified by:
findByIdin interfaceReactiveCosmosRepository<T,K extends Serializable>- Parameters:
id- must not be null.partitionKey- partition key value of the entity, must not be null.- Returns:
Monoemitting the entity with the given id orMono.empty()if none found.
-
existsById
public Mono<Boolean> existsById(K id)
- Specified by:
existsByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
existsById
public Mono<Boolean> existsById(org.reactivestreams.Publisher<K> publisher)
- Specified by:
existsByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
findAll
public Flux<T> findAll()
- Specified by:
findAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
findAllById
public Flux<T> findAllById(Iterable<K> ids)
- Specified by:
findAllByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
findAllById
public Flux<T> findAllById(org.reactivestreams.Publisher<K> ids)
- Specified by:
findAllByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
count
public Mono<Long> count()
- Specified by:
countin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
deleteById
public Mono<Void> deleteById(K id)
- Specified by:
deleteByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
deleteById
public Mono<Void> deleteById(org.reactivestreams.Publisher<K> publisher)
- Specified by:
deleteByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
deleteById
public Mono<Void> deleteById(K id, PartitionKey partitionKey)
Description copied from interface:ReactiveCosmosRepositoryDeletes an entity by its id and partition key.- Specified by:
deleteByIdin interfaceReactiveCosmosRepository<T,K extends Serializable>- Parameters:
id- must not be null.partitionKey- partition key value of the entity, must not be null.- Returns:
Monoemitting the void Mono.
-
delete
public Mono<Void> delete(@NonNull T entity)
- Specified by:
deletein interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
deleteAllById
public Mono<Void> deleteAllById(Iterable<? extends K> ids)
- Specified by:
deleteAllByIdin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
deleteAll
public Mono<Void> deleteAll(Iterable<? extends T> entities)
- Specified by:
deleteAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
deleteAll
public Mono<Void> deleteAll(org.reactivestreams.Publisher<? extends T> entityStream)
- Specified by:
deleteAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
deleteAll
public Mono<Void> deleteAll()
- Specified by:
deleteAllin interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,K extends Serializable>
-
-