Interface BlockingReactorRepositoryOperations
-
- All Superinterfaces:
io.micronaut.context.ApplicationContextProvider
,HintsCapableRepository
,ReactiveCapableRepository
,ReactorReactiveCapableRepository
,RepositoryOperations
- All Known Subinterfaces:
BlockingReactorRepositoryOperations
public interface BlockingReactorRepositoryOperations extends RepositoryOperations, ReactorReactiveCapableRepository
Implementation ofRepositoryOperations
that blocks every call fromReactorReactiveRepositoryOperations
.- Since:
- 3.3.0
- Author:
- Denis Stepanov
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <T> long
count(PagedQuery<T> pagedQuery)
Counts all results for the given query.default <T> int
delete(DeleteOperation<T> operation)
Deletes the entity.default <T> java.util.Optional<java.lang.Number>
deleteAll(DeleteBatchOperation<T> operation)
Deletes all the entities of the given type.default java.util.Optional<java.lang.Number>
executeDelete(PreparedQuery<?,java.lang.Number> preparedQuery)
Executes a delete for the given query and parameter values.default java.util.Optional<java.lang.Number>
executeUpdate(PreparedQuery<?,java.lang.Number> preparedQuery)
Executes an update for the given query and parameter values.default <T> boolean
exists(PreparedQuery<T,java.lang.Boolean> preparedQuery)
Execute a query that checks for existence.default <T> java.lang.Iterable<T>
findAll(PagedQuery<T> query)
Finds all results for the given query.default <T,R>
java.lang.Iterable<R>findAll(PreparedQuery<T,R> preparedQuery)
Finds all results for the given query.default <T,R>
RfindOne(PreparedQuery<T,R> preparedQuery)
Find one by Query.default <T> T
findOne(java.lang.Class<T> type, java.io.Serializable id)
Find one by ID.default <R> Page<R>
findPage(PagedQuery<R> query)
Find a page for the given entity and pageable.default <T> java.util.stream.Stream<T>
findStream(PagedQuery<T> query)
Finds a stream for the given arguments.default <T,R>
java.util.stream.Stream<R>findStream(PreparedQuery<T,R> preparedQuery)
Finds all results for the given query.default <T> T
persist(InsertOperation<T> operation)
Persist the operation returning a possibly new entity.default <T> java.lang.Iterable<T>
persistAll(InsertBatchOperation<T> operation)
Persist all the given entities.default <T> T
update(UpdateOperation<T> operation)
Updates the entity for the given operation.default <T> java.lang.Iterable<T>
updateAll(UpdateBatchOperation<T> operation)
Updates the entities for the given operation.-
Methods inherited from interface io.micronaut.context.ApplicationContextProvider
getApplicationContext
-
Methods inherited from interface io.micronaut.data.operations.HintsCapableRepository
getQueryHints
-
Methods inherited from interface io.micronaut.data.operations.reactive.ReactorReactiveCapableRepository
reactive
-
Methods inherited from interface io.micronaut.data.operations.RepositoryOperations
getConversionService, getEntity
-
-
-
-
Method Detail
-
findOne
@Nullable default <T> T findOne(@NonNull java.lang.Class<T> type, @NonNull java.io.Serializable id)
Description copied from interface:RepositoryOperations
Find one by ID.- Specified by:
findOne
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
type
- The typeid
- The id- Returns:
- A result or null
-
findOne
@Nullable default <T,R> R findOne(@NonNull PreparedQuery<T,R> preparedQuery)
Description copied from interface:RepositoryOperations
Find one by Query.- Specified by:
findOne
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic resultTypeR
- The result type- Parameters:
preparedQuery
- The prepared query- Returns:
- A result or null
-
findAll
@NonNull default <T,R> java.lang.Iterable<R> findAll(@NonNull PreparedQuery<T,R> preparedQuery)
Description copied from interface:RepositoryOperations
Finds all results for the given query.- Specified by:
findAll
in interfaceRepositoryOperations
- Type Parameters:
T
- The entity typeR
- The result type- Parameters:
preparedQuery
- The prepared query- Returns:
- An iterable result
-
findStream
@NonNull default <T,R> java.util.stream.Stream<R> findStream(@NonNull PreparedQuery<T,R> preparedQuery)
Description copied from interface:RepositoryOperations
Finds all results for the given query.- Specified by:
findStream
in interfaceRepositoryOperations
- Type Parameters:
T
- The entity typeR
- The result type- Parameters:
preparedQuery
- The prepared query- Returns:
- An iterable result
-
persist
@NonNull default <T> T persist(@NonNull InsertOperation<T> operation)
Description copied from interface:RepositoryOperations
Persist the operation returning a possibly new entity.- Specified by:
persist
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
operation
- The operation- Returns:
- The operation
-
update
@NonNull default <T> T update(@NonNull UpdateOperation<T> operation)
Description copied from interface:RepositoryOperations
Updates the entity for the given operation.- Specified by:
update
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
operation
- The operation- Returns:
- The operation
-
updateAll
default <T> java.lang.Iterable<T> updateAll(UpdateBatchOperation<T> operation)
Description copied from interface:RepositoryOperations
Updates the entities for the given operation.- Specified by:
updateAll
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
operation
- The operation- Returns:
- The updated entities
-
persistAll
@NonNull default <T> java.lang.Iterable<T> persistAll(@NonNull InsertBatchOperation<T> operation)
Description copied from interface:RepositoryOperations
Persist all the given entities.- Specified by:
persistAll
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
operation
- The operation- Returns:
- The entities, possibly mutated
-
executeUpdate
@NonNull default java.util.Optional<java.lang.Number> executeUpdate(@NonNull PreparedQuery<?,java.lang.Number> preparedQuery)
Description copied from interface:RepositoryOperations
Executes 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:
executeUpdate
in interfaceRepositoryOperations
- Parameters:
preparedQuery
- The prepared query- Returns:
- An optional number with the count of the number of records updated
-
executeDelete
default java.util.Optional<java.lang.Number> executeDelete(@NonNull PreparedQuery<?,java.lang.Number> preparedQuery)
Description copied from interface:RepositoryOperations
Executes a delete for the given query and parameter values. If it is possible to return the number of objects deleted, then do so.- Specified by:
executeDelete
in interfaceRepositoryOperations
- Parameters:
preparedQuery
- The prepared query- Returns:
- An optional number with the count of the number of records updated
-
delete
default <T> int delete(@NonNull DeleteOperation<T> operation)
Description copied from interface:RepositoryOperations
Deletes the entity.- Specified by:
delete
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
operation
- The operation- Returns:
- The number of entities deleted
-
deleteAll
default <T> java.util.Optional<java.lang.Number> deleteAll(@NonNull DeleteBatchOperation<T> operation)
Description copied from interface:RepositoryOperations
Deletes all the entities of the given type.- Specified by:
deleteAll
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
operation
- The operation- Returns:
- The number of entities deleted
-
exists
default <T> boolean exists(@NonNull PreparedQuery<T,java.lang.Boolean> preparedQuery)
Description copied from interface:RepositoryOperations
Execute a query that checks for existence.- Specified by:
exists
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic resultType- Parameters:
preparedQuery
- The prepared query- Returns:
- A result or null
-
findPage
default <R> Page<R> findPage(@NonNull PagedQuery<R> query)
Description copied from interface:RepositoryOperations
Find a page for the given entity and pageable.- Specified by:
findPage
in interfaceRepositoryOperations
- Type Parameters:
R
- The entity generic type- Parameters:
query
- The query- Returns:
- The page type
-
findAll
@NonNull default <T> java.lang.Iterable<T> findAll(@NonNull PagedQuery<T> query)
Description copied from interface:RepositoryOperations
Finds all results for the given query.- Specified by:
findAll
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
query
- The root entity- Returns:
- An iterable result
-
count
default <T> long count(PagedQuery<T> pagedQuery)
Description copied from interface:RepositoryOperations
Counts all results for the given query.- Specified by:
count
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
pagedQuery
- The paged query- Returns:
- An iterable result
-
findStream
@NonNull default <T> java.util.stream.Stream<T> findStream(@NonNull PagedQuery<T> query)
Description copied from interface:RepositoryOperations
Finds a stream for the given arguments.- Specified by:
findStream
in interfaceRepositoryOperations
- Type Parameters:
T
- The generic type- Parameters:
query
- The query- Returns:
- The stream
-
-