Class DefaultReactiveCosmosRepositoryOperations
java.lang.Object
io.micronaut.data.runtime.operations.internal.AbstractRepositoryOperations
io.micronaut.data.cosmos.operations.DefaultReactiveCosmosRepositoryOperations
- All Implemented Interfaces:
- io.micronaut.context.ApplicationContextProvider,- io.micronaut.core.convert.ConversionServiceProvider,- ReactiveRepositoryOperations,- ReactorReactiveRepositoryOperations,- MethodContextAwareStoredQueryDecorator,- PreparedQueryDecorator
@Singleton
@Internal
public final class DefaultReactiveCosmosRepositoryOperations
extends AbstractRepositoryOperations
implements ReactorReactiveRepositoryOperations, ReactiveRepositoryOperations, MethodContextAwareStoredQueryDecorator, PreparedQueryDecorator
The reactive Cosmos DB repository operations implementation.
- Since:
- 3.9.0
- Author:
- radovanradic
- 
Field SummaryFields inherited from class io.micronaut.data.runtime.operations.internal.AbstractRepositoryOperationsattributeConverterRegistry, conversionService, dateTimeProvider, entityEventRegistry, runtimeEntityRegistry
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultReactiveCosmosRepositoryOperations(DateTimeProvider<Object> dateTimeProvider, RuntimeEntityRegistry runtimeEntityRegistry, DataConversionService conversionService, AttributeConverterRegistry attributeConverterRegistry, com.azure.cosmos.CosmosAsyncClient cosmosAsyncClient, io.micronaut.data.cosmos.operations.CosmosSerde cosmosSerde, @Nullable CosmosDiagnosticsProcessor cosmosDiagnosticsProcessor, CosmosDatabaseConfiguration configuration) Default constructor.
- 
Method SummaryModifier and TypeMethodDescription<T> @NonNull reactor.core.publisher.Mono<Long>count(PagedQuery<T> pagedQuery) Counts all results for the given query.<E,R> StoredQuery<E, R> decorate(io.micronaut.aop.MethodInvocationContext<?, ?> context, StoredQuery<E, R> storedQuery) Decorate stored query.<E,R> PreparedQuery<E, R> decorate(PreparedQuery<E, R> preparedQuery) Decorate prepared query.<T> @NonNull reactor.core.publisher.Mono<Number>delete(@NonNull DeleteOperation<T> operation) Deletes the entity.<T> @NonNull reactor.core.publisher.Mono<Number>deleteAll(@NonNull DeleteBatchOperation<T> operation) Deletes all the entities of the given type.@NonNull reactor.core.publisher.Mono<Number>executeDelete(@NonNull PreparedQuery<?, Number> pq) Executes a batch delete for the given query and parameter values.@NonNull reactor.core.publisher.Mono<Number>executeUpdate(@NonNull PreparedQuery<?, Number> pq) Executes an update for the given query and parameter values.<T> reactor.core.publisher.Mono<Boolean>exists(@NonNull PreparedQuery<T, Boolean> pq) Check with an record exists for the given query.<T,R> @NonNull reactor.core.publisher.Flux<R> findAll(@NonNull PreparedQuery<T, R> pq) Finds all results for the given query.<T> @NonNull reactor.core.publisher.Flux<T>findAll(PagedQuery<T> pagedQuery) Finds all results for the given query.<T,R> @NonNull reactor.core.publisher.Mono<R> findOne(@NonNull PreparedQuery<T, R> pq) Find one by Query.<T> @NonNull reactor.core.publisher.Mono<T>Find one by ID.<T,R> @NonNull reactor.core.publisher.Mono<R> findOptional(@NonNull PreparedQuery<T, R> preparedQuery) Find one by Query.<T> @NonNull reactor.core.publisher.Mono<T>findOptional(@NonNull Class<T> type, @NonNull Object id) Find one by ID.<R> @NonNull reactor.core.publisher.Mono<Page<R>>findPage(@NonNull PagedQuery<R> pagedQuery) Find a page for the given entity and pageable.<T> @NonNull reactor.core.publisher.Mono<T>persist(@NonNull InsertOperation<T> operation) Persist the entity returning a possibly new entity.<T> @NonNull reactor.core.publisher.Flux<T>persistAll(@NonNull InsertBatchOperation<T> operation) Persist all the given entities.<T> @NonNull reactor.core.publisher.Mono<T>update(@NonNull UpdateOperation<T> operation) Updates the entity returning a possibly new entity.<T> @NonNull reactor.core.publisher.Flux<T>updateAll(@NonNull UpdateBatchOperation<T> operation) Updates the entities for the given operation.Methods inherited from class io.micronaut.data.runtime.operations.internal.AbstractRepositoryOperationscheckOptimisticLocking, getApplicationContext, getConversionService, getEntity, getIdReader, isOnlySingleEndedJoins, triggerPostLoadMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.convert.ConversionServiceProvidergetConversionService
- 
Constructor Details- 
DefaultReactiveCosmosRepositoryOperationspublic DefaultReactiveCosmosRepositoryOperations(DateTimeProvider<Object> dateTimeProvider, RuntimeEntityRegistry runtimeEntityRegistry, DataConversionService conversionService, AttributeConverterRegistry attributeConverterRegistry, com.azure.cosmos.CosmosAsyncClient cosmosAsyncClient, io.micronaut.data.cosmos.operations.CosmosSerde cosmosSerde, @Nullable @Nullable CosmosDiagnosticsProcessor cosmosDiagnosticsProcessor, CosmosDatabaseConfiguration configuration) Default constructor.- Parameters:
- dateTimeProvider- The date time provider
- runtimeEntityRegistry- The entity registry
- conversionService- The conversion service
- attributeConverterRegistry- The attribute converter registry
- cosmosAsyncClient- The Cosmos async client
- cosmosSerde- The Cosmos de/serialization helper
- cosmosDiagnosticsProcessor- The Cosmos diagnostics processor, can be null
- configuration- The Cosmos database configuration
 
 
- 
- 
Method Details- 
decorateDescription copied from interface:PreparedQueryDecoratorDecorate prepared query.- Specified by:
- decoratein interface- PreparedQueryDecorator
- Type Parameters:
- E- The entity type
- R- The result type
- Parameters:
- preparedQuery- The query to be decorated
- Returns:
- decorated prepared query
 
- 
decoratepublic <E,R> StoredQuery<E,R> decorate(io.micronaut.aop.MethodInvocationContext<?, ?> context, StoredQuery<E, R> storedQuery) Description copied from interface:MethodContextAwareStoredQueryDecoratorDecorate stored query.- Specified by:
- decoratein interface- MethodContextAwareStoredQueryDecorator
- Type Parameters:
- E- The entity type
- R- The result type
- Parameters:
- context- The context
- storedQuery- The query to be decorated
- Returns:
- decorated stored query
 
- 
findOne@NonNull public <T> @NonNull reactor.core.publisher.Mono<T> findOne(@NonNull @NonNull Class<T> type, Object id) Description copied from interface:ReactiveRepositoryOperationsFind one by ID.- Specified by:
- findOnein interface- ReactiveRepositoryOperations
- Specified by:
- findOnein interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- type- The type
- id- The id
- Returns:
- A publisher that emits the result
 
- 
existspublic <T> reactor.core.publisher.Mono<Boolean> exists(@NonNull @NonNull PreparedQuery<T, Boolean> pq) Description copied from interface:ReactiveRepositoryOperationsCheck with an record exists for the given query.- Specified by:
- existsin interface- ReactiveRepositoryOperations
- Specified by:
- existsin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The declaring type
- Parameters:
- pq- The query
- Returns:
- True if it exists
 
- 
findOne@NonNull public <T,R> @NonNull reactor.core.publisher.Mono<R> findOne(@NonNull @NonNull PreparedQuery<T, R> pq) Description copied from interface:ReactiveRepositoryOperationsFind one by Query.- Specified by:
- findOnein interface- ReactiveRepositoryOperations
- Specified by:
- findOnein interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic resultType
- R- The result type
- Parameters:
- pq- The prepared query
- Returns:
- A publisher that emits the result
 
- 
findOptional@NonNull public <T> @NonNull reactor.core.publisher.Mono<T> findOptional(@NonNull @NonNull Class<T> type, @NonNull @NonNull Object id) Description copied from interface:ReactiveRepositoryOperationsFind one by ID.- Specified by:
- findOptionalin interface- ReactiveRepositoryOperations
- Specified by:
- findOptionalin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- type- The type
- id- The id
- Returns:
- A publisher that emits zero or one result
 
- 
findOptional@NonNull public <T,R> @NonNull reactor.core.publisher.Mono<R> findOptional(@NonNull @NonNull PreparedQuery<T, R> preparedQuery) Description copied from interface:ReactiveRepositoryOperationsFind one by Query.- Specified by:
- findOptionalin interface- ReactiveRepositoryOperations
- Specified by:
- findOptionalin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic resultType
- R- The result type
- Parameters:
- preparedQuery- The prepared query
- Returns:
- A publisher that emits the zero or one result
 
- 
findAllDescription copied from interface:ReactiveRepositoryOperationsFinds all results for the given query.- Specified by:
- findAllin interface- ReactiveRepositoryOperations
- Specified by:
- findAllin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- pagedQuery- The paged query
- Returns:
- A publisher that emits the results
 
- 
countDescription copied from interface:ReactiveRepositoryOperationsCounts all results for the given query.- Specified by:
- countin interface- ReactiveRepositoryOperations
- Specified by:
- countin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- pagedQuery- The paged query
- Returns:
- A publisher that emits the count as a long
 
- 
findAll@NonNull public <T,R> @NonNull reactor.core.publisher.Flux<R> findAll(@NonNull @NonNull PreparedQuery<T, R> pq) Description copied from interface:ReactiveRepositoryOperationsFinds all results for the given query.- Specified by:
- findAllin interface- ReactiveRepositoryOperations
- Specified by:
- findAllin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The entity type
- R- The result type
- Parameters:
- pq- The prepared query
- Returns:
- A publisher that emits an iterable with all results
 
- 
persist@NonNull public <T> @NonNull reactor.core.publisher.Mono<T> persist(@NonNull @NonNull InsertOperation<T> operation) Description copied from interface:ReactiveRepositoryOperationsPersist the entity returning a possibly new entity.- Specified by:
- persistin interface- ReactiveRepositoryOperations
- Specified by:
- persistin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- operation- The entity operation
- Returns:
- A publisher that emits the entity
 
- 
update@NonNull public <T> @NonNull reactor.core.publisher.Mono<T> update(@NonNull @NonNull UpdateOperation<T> operation) Description copied from interface:ReactiveRepositoryOperationsUpdates the entity returning a possibly new entity.- Specified by:
- updatein interface- ReactiveRepositoryOperations
- Specified by:
- updatein interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- operation- The entity operation
- Returns:
- A publisher that emits the entity
 
- 
updateAll@NonNull public <T> @NonNull reactor.core.publisher.Flux<T> updateAll(@NonNull @NonNull UpdateBatchOperation<T> operation) Description copied from interface:ReactiveRepositoryOperationsUpdates the entities for the given operation.- Specified by:
- updateAllin interface- ReactiveRepositoryOperations
- Specified by:
- updateAllin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- operation- The operation
- Returns:
- The updated entities
 
- 
persistAll@NonNull public <T> @NonNull reactor.core.publisher.Flux<T> persistAll(@NonNull @NonNull InsertBatchOperation<T> operation) Description copied from interface:ReactiveRepositoryOperationsPersist all the given entities.- Specified by:
- persistAllin interface- ReactiveRepositoryOperations
- Specified by:
- persistAllin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- operation- The batch operation
- Returns:
- The entities, possibly mutated
 
- 
executeUpdate@NonNull public @NonNull reactor.core.publisher.Mono<Number> executeUpdate(@NonNull @NonNull PreparedQuery<?, Number> pq) Description copied from interface:ReactiveRepositoryOperationsExecutes an update for the given query and parameter values. If it is possible to return the number of objects updated, then do so.- Specified by:
- executeUpdatein interface- ReactiveRepositoryOperations
- Specified by:
- executeUpdatein interface- ReactorReactiveRepositoryOperations
- Parameters:
- pq- The prepared query
- Returns:
- A publisher that emits a boolean true if the update was successful
 
- 
executeDelete@NonNull public @NonNull reactor.core.publisher.Mono<Number> executeDelete(@NonNull @NonNull PreparedQuery<?, Number> pq) Description copied from interface:ReactiveRepositoryOperationsExecutes a batch delete for the given query and parameter values. If it is possible to return the number of objects updated, then do so.- Specified by:
- executeDeletein interface- ReactiveRepositoryOperations
- Specified by:
- executeDeletein interface- ReactorReactiveRepositoryOperations
- Parameters:
- pq- The prepared query
- Returns:
- A publisher that emits a boolean true if the update was successful
 
- 
delete@NonNull public <T> @NonNull reactor.core.publisher.Mono<Number> delete(@NonNull @NonNull DeleteOperation<T> operation) Description copied from interface:ReactiveRepositoryOperationsDeletes the entity.- Specified by:
- deletein interface- ReactiveRepositoryOperations
- Specified by:
- deletein interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- operation- The batch operation
- Returns:
- A publisher that emits the number of entities deleted
 
- 
deleteAll@NonNull public <T> @NonNull reactor.core.publisher.Mono<Number> deleteAll(@NonNull @NonNull DeleteBatchOperation<T> operation) Description copied from interface:ReactiveRepositoryOperationsDeletes all the entities of the given type.- Specified by:
- deleteAllin interface- ReactiveRepositoryOperations
- Specified by:
- deleteAllin interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- T- The generic type
- Parameters:
- operation- The batch operation
- Returns:
- A publisher that emits the number of entities deleted
 
- 
findPage@NonNull public <R> @NonNull reactor.core.publisher.Mono<Page<R>> findPage(@NonNull @NonNull PagedQuery<R> pagedQuery) Description copied from interface:ReactiveRepositoryOperationsFind a page for the given entity and pageable.- Specified by:
- findPagein interface- ReactiveRepositoryOperations
- Specified by:
- findPagein interface- ReactorReactiveRepositoryOperations
- Type Parameters:
- R- The entity generic type
- Parameters:
- pagedQuery- The paged query
- Returns:
- The page type
 
 
-