Interface ReactiveRepositoryOperations
- All Superinterfaces:
io.micronaut.core.convert.ConversionServiceProvider
- All Known Subinterfaces:
HibernateReactorRepositoryOperations,MongoReactiveRepositoryOperations,MongoReactorRepositoryOperations,ReactorReactiveRepositoryOperations,ReactorReactiveRepositoryOperations
- All Known Implementing Classes:
DefaultReactiveCosmosRepositoryOperations,DefaultReactiveMongoRepositoryOperations,ExecutorReactiveOperations,ExecutorReactiveOperationsSupportingCriteria
public interface ReactiveRepositoryOperations
extends io.micronaut.core.convert.ConversionServiceProvider
Reactive operations for reading data from a backing implementations.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescription<T> @NonNull org.reactivestreams.Publisher<Long>count(PagedQuery<T> pagedQuery) Counts all results for the given query.<T> @NonNull org.reactivestreams.Publisher<Number>delete(@NonNull DeleteOperation<T> operation) Deletes the entity.<T> @NonNull org.reactivestreams.Publisher<Number>deleteAll(@NonNull DeleteBatchOperation<T> operation) Deletes all the entities of the given type.default <R> @NonNull org.reactivestreams.Publisher<R>execute(@NonNull PreparedQuery<?, R> preparedQuery) Executes the given query with parameter values returning a result.default @NonNull org.reactivestreams.Publisher<Number>executeDelete(@NonNull PreparedQuery<?, Number> preparedQuery) Executes a batch delete for the given query and parameter values.@NonNull org.reactivestreams.Publisher<Number>executeUpdate(@NonNull PreparedQuery<?, Number> preparedQuery) Executes an update for the given query and parameter values.<T> @NonNull org.reactivestreams.Publisher<Boolean>exists(@NonNull PreparedQuery<T, Boolean> preparedQuery) Check with a record exists for the given query.<T,R> @NonNull org.reactivestreams.Publisher<R> findAll(@NonNull PreparedQuery<T, R> preparedQuery) Finds all results for the given query.<T> @NonNull org.reactivestreams.Publisher<T>findAll(PagedQuery<T> pagedQuery) Finds all results for the given query.<T,R> @NonNull org.reactivestreams.Publisher<R> findOne(@NonNull PreparedQuery<T, R> preparedQuery) Find one by Query.<T> @NonNull org.reactivestreams.Publisher<T>Find one by ID.<T,R> @NonNull org.reactivestreams.Publisher<R> findOptional(@NonNull PreparedQuery<T, R> preparedQuery) Find one by Query.<T> @NonNull org.reactivestreams.Publisher<T>findOptional(@NonNull Class<T> type, @NonNull Object id) Find one by ID.<R> @NonNull org.reactivestreams.Publisher<Page<R>>findPage(@NonNull PagedQuery<R> pagedQuery) Find a page for the given entity and pageable.<T> @NonNull org.reactivestreams.Publisher<T>persist(@NonNull InsertOperation<T> operation) Persist the entity returning a possibly new entity.<T> @NonNull org.reactivestreams.Publisher<T>persistAll(@NonNull InsertBatchOperation<T> operation) Persist all the given entities.<T> @NonNull org.reactivestreams.Publisher<T>update(@NonNull UpdateOperation<T> operation) Updates the entity returning a possibly new entity.<T> @NonNull org.reactivestreams.Publisher<T>updateAll(@NonNull UpdateBatchOperation<T> operation) Updates the entities for the given operation.Methods inherited from interface io.micronaut.core.convert.ConversionServiceProvider
getConversionService
-
Method Details
-
findOne
@NonNull @SingleResult <T> @NonNull org.reactivestreams.Publisher<T> findOne(@NonNull @NonNull Class<T> type, @NonNull @NonNull Object id) Find one by ID.- Type Parameters:
T- The generic type- Parameters:
type- The typeid- The id- Returns:
- A publisher that emits the result
-
exists
@NonNull @SingleResult <T> @NonNull org.reactivestreams.Publisher<Boolean> exists(@NonNull @NonNull PreparedQuery<T, Boolean> preparedQuery) Check with a record exists for the given query.- Type Parameters:
T- The declaring type- Parameters:
preparedQuery- The query- Returns:
- True if it exists
-
findOne
@NonNull @SingleResult <T,R> @NonNull org.reactivestreams.Publisher<R> findOne(@NonNull @NonNull PreparedQuery<T, R> preparedQuery) Find one by Query.- Type Parameters:
T- The generic resultTypeR- The result type- Parameters:
preparedQuery- The prepared query- Returns:
- A publisher that emits the result
-
findOptional
@NonNull @SingleResult <T> @NonNull org.reactivestreams.Publisher<T> findOptional(@NonNull @NonNull Class<T> type, @NonNull @NonNull Object id) Find one by ID.- Type Parameters:
T- The generic type- Parameters:
type- The typeid- The id- Returns:
- A publisher that emits zero or one result
-
findOptional
@NonNull @SingleResult <T,R> @NonNull org.reactivestreams.Publisher<R> findOptional(@NonNull @NonNull PreparedQuery<T, R> preparedQuery) Find one by Query.- Type Parameters:
T- The generic resultTypeR- The result type- Parameters:
preparedQuery- The prepared query- Returns:
- A publisher that emits the zero or one result
-
findAll
Finds all results for the given query.- Type Parameters:
T- The generic type- Parameters:
pagedQuery- The paged query- Returns:
- A publisher that emits the results
-
count
@NonNull @SingleResult <T> @NonNull org.reactivestreams.Publisher<Long> count(PagedQuery<T> pagedQuery) Counts all results for the given query.- Type Parameters:
T- The generic type- Parameters:
pagedQuery- The paged query- Returns:
- A publisher that emits the count as a long
-
findAll
@NonNull <T,R> @NonNull org.reactivestreams.Publisher<R> findAll(@NonNull @NonNull PreparedQuery<T, R> preparedQuery) Finds all results for the given query.- Type Parameters:
T- The entity typeR- The result type- Parameters:
preparedQuery- The prepared query- Returns:
- A publisher that emits an iterable with all results
-
persist
@NonNull @SingleResult <T> @NonNull org.reactivestreams.Publisher<T> persist(@NonNull @NonNull InsertOperation<T> operation) Persist the entity returning a possibly new entity.- Type Parameters:
T- The generic type- Parameters:
operation- The entity operation- Returns:
- A publisher that emits the entity
-
update
@NonNull @SingleResult <T> @NonNull org.reactivestreams.Publisher<T> update(@NonNull @NonNull UpdateOperation<T> operation) Updates the entity returning a possibly new entity.- Type Parameters:
T- The generic type- Parameters:
operation- The entity operation- Returns:
- A publisher that emits the entity
-
updateAll
@NonNull <T> @NonNull org.reactivestreams.Publisher<T> updateAll(@NonNull @NonNull UpdateBatchOperation<T> operation) Updates the entities for the given operation.- Type Parameters:
T- The generic type- Parameters:
operation- The operation- Returns:
- The updated entities
-
persistAll
@NonNull <T> @NonNull org.reactivestreams.Publisher<T> persistAll(@NonNull @NonNull InsertBatchOperation<T> operation) Persist all the given entities.- Type Parameters:
T- The generic type- Parameters:
operation- The batch operation- Returns:
- The entities, possibly mutated
-
executeUpdate
@NonNull @SingleResult @NonNull org.reactivestreams.Publisher<Number> executeUpdate(@NonNull @NonNull PreparedQuery<?, Number> preparedQuery) Executes an update for the given query and parameter values. If it is possible to return the number of objects updated, then do so.- Parameters:
preparedQuery- The prepared query- Returns:
- A publisher that emits a boolean true if the update was successful
-
executeDelete
@NonNull @SingleResult default @NonNull org.reactivestreams.Publisher<Number> executeDelete(@NonNull @NonNull PreparedQuery<?, Number> preparedQuery) Executes a batch delete for the given query and parameter values. If it is possible to return the number of objects updated, then do so.- Parameters:
preparedQuery- The prepared query- Returns:
- A publisher that emits a boolean true if the update was successful
-
execute
@NonNull default <R> @NonNull org.reactivestreams.Publisher<R> execute(@NonNull @NonNull PreparedQuery<?, R> preparedQuery) Executes the given query with parameter values returning a result.- Type Parameters:
R- The result type- Parameters:
preparedQuery- The prepared query- Returns:
- A publisher that emits the result
- Since:
- 4.2.0
-
delete
@NonNull @SingleResult <T> @NonNull org.reactivestreams.Publisher<Number> delete(@NonNull @NonNull DeleteOperation<T> operation) Deletes the entity.- Type Parameters:
T- The generic type- Parameters:
operation- The batch operation- Returns:
- A publisher that emits the number of entities deleted
-
deleteAll
@NonNull @SingleResult <T> @NonNull org.reactivestreams.Publisher<Number> deleteAll(@NonNull @NonNull DeleteBatchOperation<T> operation) Deletes all the entities of the given type.- Type Parameters:
T- The generic type- Parameters:
operation- The batch operation- Returns:
- A publisher that emits the number of entities deleted
-
findPage
@NonNull @SingleResult <R> @NonNull org.reactivestreams.Publisher<Page<R>> findPage(@NonNull @NonNull PagedQuery<R> pagedQuery) Find a page for the given entity and pageable.- Type Parameters:
R- The entity generic type- Parameters:
pagedQuery- The paged query- Returns:
- The page type
-