Interface ReactiveCosmosRepository<T,K>

Type Parameters:
T - the type of the domain class.
K - the type of the id of the entity the repository manages.
All Superinterfaces:
org.springframework.data.repository.reactive.ReactiveCrudRepository<T,K>, org.springframework.data.repository.reactive.ReactiveSortingRepository<T,K>, org.springframework.data.repository.Repository<T,K>
All Known Implementing Classes:
SimpleReactiveCosmosRepository

@NoRepositoryBean public interface ReactiveCosmosRepository<T,K> extends org.springframework.data.repository.reactive.ReactiveSortingRepository<T,K>, org.springframework.data.repository.reactive.ReactiveCrudRepository<T,K>
Repository interface with search and delete operation
  • Method Summary

    Modifier and Type
    Method
    Description
    deleteById(K id, com.azure.cosmos.models.PartitionKey partitionKey)
    Deletes an entity by its id and partition key.
    findAll(com.azure.cosmos.models.PartitionKey partitionKey)
    Returns Flux of items in a specific partition
    findById(K id, com.azure.cosmos.models.PartitionKey partitionKey)
    Retrieves an entity by its id and partition key.
    <S extends T>
    Mono<S>
    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 CosmosPatchItemRequestOptions
    <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)
    Patches an entity by its id and partition key with CosmosPatchItemRequestOptions

    Methods inherited from interface org.springframework.data.repository.reactive.ReactiveCrudRepository

    count, delete, deleteAll, deleteAll, deleteAll, deleteAllById, deleteById, deleteById, existsById, existsById, findAll, findAllById, findAllById, findById, findById, save, saveAll, saveAll

    Methods inherited from interface org.springframework.data.repository.reactive.ReactiveSortingRepository

    findAll
  • Method Details

    • findById

      Mono<T> findById(K id, com.azure.cosmos.models.PartitionKey partitionKey)
      Retrieves an entity by its id and partition key.
      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 or Mono.empty() if none found.
      Throws:
      IllegalArgumentException - in case the given id is null.
    • deleteById

      Mono<Void> deleteById(K id, com.azure.cosmos.models.PartitionKey partitionKey)
      Deletes an entity by its id and partition key.
      Parameters:
      id - must not be null.
      partitionKey - partition key value of the entity, must not be null.
      Returns:
      Mono emitting the void Mono.
      Throws:
      IllegalArgumentException - in case the given id is null.
    • save

      <S extends T> Mono<S> 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 CosmosPatchItemRequestOptions
      Type Parameters:
      S - type class of domain type
      Parameters:
      id - must not be null
      partitionKey - must not be null
      domainType - must not be null
      patchOperations - must not be null, max operations is 10
      Returns:
      the patched entity
      Throws:
      IllegalArgumentException - in case the given id is null.
    • save

      <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)
      Patches an entity by its id and partition key with CosmosPatchItemRequestOptions
      Type Parameters:
      S - type class of domain type
      Parameters:
      id - must not be null
      partitionKey - must not be null
      domainType - must not be null
      patchOperations - must not be null, max operations is 10
      options - Optional CosmosPatchItemRequestOptions, e.g. options.setFilterPredicate("FROM products p WHERE p.used = false");
      Returns:
      the patched entity
      Throws:
      IllegalArgumentException - in case the given id is null.
    • findAll

      Flux<T> findAll(com.azure.cosmos.models.PartitionKey partitionKey)
      Returns Flux of items in a specific partition
      Parameters:
      partitionKey - partition key value
      Returns:
      Flux of items with partition key value