Class SimpleReactiveCosmosRepository<T,K extends Serializable>
java.lang.Object
com.azure.spring.data.cosmos.repository.support.SimpleReactiveCosmosRepository<T,K>
- Type Parameters:
T
- the type of the domain class managed by this repository.K
- the type of the id of the domain class managed by this repository.
- 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
ConstructorsConstructorDescriptionSimpleReactiveCosmosRepository
(CosmosEntityInformation<T, K> metadata, ReactiveCosmosOperations reactiveCosmosOperations) Initialization with metadata and reactiveCosmosOperations -
Method Summary
Modifier and TypeMethodDescriptioncount()
deleteAllById
(Iterable<? extends K> ids) deleteById
(K id) deleteById
(K id, com.azure.cosmos.models.PartitionKey partitionKey) Deletes an entity by its id and partition key.deleteById
(org.reactivestreams.Publisher<K> publisher) existsById
(K id) existsById
(org.reactivestreams.Publisher<K> publisher) findAll()
findAll
(com.azure.cosmos.models.PartitionKey partitionKey) Returns Flux of items in a specific partitionfindAll
(org.springframework.data.domain.Sort sort) findAllById
(Iterable<K> ids) findAllById
(org.reactivestreams.Publisher<K> ids) Retrieves an entity by its id and partition key.save
(K id, com.azure.cosmos.models.PartitionKey partitionKey, Class<S> domainType, com.azure.cosmos.models.CosmosPatchOperations patchOperations) Patches an entity by its id and partition key with CosmosPatchItemRequestOptionssave
(K id, com.azure.cosmos.models.PartitionKey partitionKey, Class<S> domainType, com.azure.cosmos.models.CosmosPatchOperations patchOperations, com.azure.cosmos.models.CosmosPatchItemRequestOptions options) Patches an entity by its id and partition key with CosmosPatchItemRequestOptionssave
(S entity) saveAll
(org.reactivestreams.Publisher<S> entityStream)
-
Constructor Details
-
SimpleReactiveCosmosRepository
public SimpleReactiveCosmosRepository(CosmosEntityInformation<T, K> metadata, ReactiveCosmosOperations reactiveCosmosOperations) Initialization with metadata and reactiveCosmosOperations- Parameters:
metadata
- for entityInformationreactiveCosmosOperations
- for cosmosOperations
-
-
Method Details
-
findAll
- Specified by:
findAll
in interfaceorg.springframework.data.repository.reactive.ReactiveSortingRepository<T,
K extends Serializable>
-
findAll
Description copied from interface:ReactiveCosmosRepository
Returns Flux of items in a specific partition- Specified by:
findAll
in interfaceReactiveCosmosRepository<T,
K extends Serializable> - Parameters:
partitionKey
- partition key value- Returns:
Flux
of items with partition key value
-
save
- Specified by:
save
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
save
public <S extends T> Mono<S> save(K id, com.azure.cosmos.models.PartitionKey partitionKey, Class<S> domainType, com.azure.cosmos.models.CosmosPatchOperations patchOperations) Description copied from interface:ReactiveCosmosRepository
Patches an entity by its id and partition key with CosmosPatchItemRequestOptions- Specified by:
save
in interfaceReactiveCosmosRepository<T,
K extends Serializable> - Type Parameters:
S
- type class of domain type- Parameters:
id
- must not be nullpartitionKey
- must not be nulldomainType
- must not be nullpatchOperations
- must not be null, max operations is 10- Returns:
- the patched entity
-
save
public <S extends T> Mono<S> save(K id, com.azure.cosmos.models.PartitionKey partitionKey, Class<S> domainType, com.azure.cosmos.models.CosmosPatchOperations patchOperations, com.azure.cosmos.models.CosmosPatchItemRequestOptions options) Description copied from interface:ReactiveCosmosRepository
Patches an entity by its id and partition key with CosmosPatchItemRequestOptions- Specified by:
save
in interfaceReactiveCosmosRepository<T,
K extends Serializable> - Type Parameters:
S
- type class of domain type- Parameters:
id
- must not be nullpartitionKey
- must not be nulldomainType
- must not be nullpatchOperations
- must not be null, max operations is 10options
- Optional CosmosPatchItemRequestOptions, e.g. options.setFilterPredicate("FROM products p WHERE p.used = false");- Returns:
- the patched entity
-
saveAll
- Specified by:
saveAll
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
saveAll
- Specified by:
saveAll
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
findById
- Specified by:
findById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
findById
- Specified by:
findById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
findById
Description copied from interface:ReactiveCosmosRepository
Retrieves an entity by its id and partition key.- Specified by:
findById
in interfaceReactiveCosmosRepository<T,
K extends Serializable> - Parameters:
id
- must not be null.partitionKey
- partition key value of the entity, must not be null.- Returns:
Mono
emitting the entity with the given id orMono.empty()
if none found.
-
existsById
- Specified by:
existsById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
existsById
- Specified by:
existsById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
findAll
- Specified by:
findAll
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
findAllById
- Specified by:
findAllById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
findAllById
- Specified by:
findAllById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
count
- Specified by:
count
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
deleteById
- Specified by:
deleteById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
deleteById
- Specified by:
deleteById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
deleteById
Description copied from interface:ReactiveCosmosRepository
Deletes an entity by its id and partition key.- Specified by:
deleteById
in interfaceReactiveCosmosRepository<T,
K extends Serializable> - Parameters:
id
- must not be null.partitionKey
- partition key value of the entity, must not be null.- Returns:
Mono
emitting the void Mono.
-
delete
- Specified by:
delete
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
deleteAllById
- Specified by:
deleteAllById
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
deleteAll
- Specified by:
deleteAll
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
deleteAll
- Specified by:
deleteAll
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-
deleteAll
- Specified by:
deleteAll
in interfaceorg.springframework.data.repository.reactive.ReactiveCrudRepository<T,
K extends Serializable>
-