public class ExecutorReactiveOperations extends java.lang.Object implements ReactiveRepositoryOperations
ReactiveRepositoryOperations that delegates to a blocking operations and specified Executor.
This can be used in absence of true reactive support at the driver level an allows composing blocking operations within reactive flows.
If a backing implementation provides a reactive API then the backing implementation should not use this class and instead directly implement the ReactiveRepositoryOperations interface.
ReactiveRepositoryOperations| Constructor and Description |
|---|
ExecutorReactiveOperations(ExecutorAsyncOperations asyncOperations)
Default constructor.
|
ExecutorReactiveOperations(RepositoryOperations datastore,
java.util.concurrent.Executor executor)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T> org.reactivestreams.Publisher<java.lang.Long> |
count(PagedQuery<T> pagedQuery)
Counts all results for the given query.
|
<T> org.reactivestreams.Publisher<java.lang.Number> |
deleteAll(BatchOperation<T> operation)
Deletes all the entities of the given type.
|
org.reactivestreams.Publisher<java.lang.Number> |
executeUpdate(PreparedQuery<?,java.lang.Number> preparedQuery)
Executes an update for the given query and parameter values.
|
<T> org.reactivestreams.Publisher<java.lang.Boolean> |
exists(PreparedQuery<T,java.lang.Boolean> preparedQuery)
Check with an record exists for the given query.
|
<T> org.reactivestreams.Publisher<T> |
findAll(PagedQuery<T> pagedQuery)
Finds all results for the given query.
|
<T,R> org.reactivestreams.Publisher<R> |
findAll(PreparedQuery<T,R> preparedQuery)
Finds all results for the given query.
|
<T> org.reactivestreams.Publisher<T> |
findOne(java.lang.Class<T> type,
java.io.Serializable id)
Find one by ID.
|
<T,R> org.reactivestreams.Publisher<R> |
findOne(PreparedQuery<T,R> preparedQuery)
Find one by Query.
|
<T> org.reactivestreams.Publisher<T> |
findOptional(java.lang.Class<T> type,
java.io.Serializable id)
Find one by ID.
|
<T,R> org.reactivestreams.Publisher<R> |
findOptional(PreparedQuery<T,R> preparedQuery)
Find one by Query.
|
<R> org.reactivestreams.Publisher<Page<R>> |
findPage(PagedQuery<R> pagedQuery)
Find a page for the given entity and pageable.
|
<T> org.reactivestreams.Publisher<T> |
persist(InsertOperation<T> entity)
Persist the entity returning a possibly new entity.
|
<T> org.reactivestreams.Publisher<T> |
persistAll(BatchOperation<T> operation)
Persist all the given entities.
|
<T> org.reactivestreams.Publisher<T> |
update(UpdateOperation<T> operation)
Updates the entity returning a possibly new entity.
|
public ExecutorReactiveOperations(@NonNull
RepositoryOperations datastore,
@NonNull
java.util.concurrent.Executor executor)
datastore - The target operationsexecutor - The executor to use.public ExecutorReactiveOperations(@NonNull
ExecutorAsyncOperations asyncOperations)
asyncOperations - The instance operations instance@NonNull
public <T> org.reactivestreams.Publisher<T> findOne(@NonNull
java.lang.Class<T> type,
@NonNull
java.io.Serializable id)
ReactiveRepositoryOperationsfindOne in interface ReactiveRepositoryOperationsT - The generic typetype - The typeid - The idpublic <T> org.reactivestreams.Publisher<java.lang.Boolean> exists(@NonNull
PreparedQuery<T,java.lang.Boolean> preparedQuery)
ReactiveRepositoryOperationsexists in interface ReactiveRepositoryOperationsT - The declaring typepreparedQuery - The query@NonNull
public <T,R> org.reactivestreams.Publisher<R> findOne(@NonNull
PreparedQuery<T,R> preparedQuery)
ReactiveRepositoryOperationsfindOne in interface ReactiveRepositoryOperationsT - The generic resultTypeR - The result typepreparedQuery - The prepared query@NonNull
public <T> org.reactivestreams.Publisher<T> findOptional(@NonNull
java.lang.Class<T> type,
@NonNull
java.io.Serializable id)
ReactiveRepositoryOperationsfindOptional in interface ReactiveRepositoryOperationsT - The generic typetype - The typeid - The id@NonNull
public <T,R> org.reactivestreams.Publisher<R> findOptional(@NonNull
PreparedQuery<T,R> preparedQuery)
ReactiveRepositoryOperationsfindOptional in interface ReactiveRepositoryOperationsT - The generic resultTypeR - The result typepreparedQuery - The prepared query@NonNull public <T> org.reactivestreams.Publisher<T> findAll(PagedQuery<T> pagedQuery)
ReactiveRepositoryOperationsfindAll in interface ReactiveRepositoryOperationsT - The generic typepagedQuery - The paged query@NonNull public <T> org.reactivestreams.Publisher<java.lang.Long> count(PagedQuery<T> pagedQuery)
ReactiveRepositoryOperationscount in interface ReactiveRepositoryOperationsT - The generic typepagedQuery - The paged query@NonNull public <R> org.reactivestreams.Publisher<Page<R>> findPage(@NonNull PagedQuery<R> pagedQuery)
ReactiveRepositoryOperationsfindPage in interface ReactiveRepositoryOperationsR - The entity generic typepagedQuery - The paged query@NonNull
public <T,R> org.reactivestreams.Publisher<R> findAll(@NonNull
PreparedQuery<T,R> preparedQuery)
ReactiveRepositoryOperationsfindAll in interface ReactiveRepositoryOperationsT - The entity typeR - The result typepreparedQuery - The prepared query@NonNull
public <T> org.reactivestreams.Publisher<T> persist(@NonNull
InsertOperation<T> entity)
ReactiveRepositoryOperationspersist in interface ReactiveRepositoryOperationsT - The generic typeentity - The entity operation@NonNull
public <T> org.reactivestreams.Publisher<T> update(@NonNull
UpdateOperation<T> operation)
ReactiveRepositoryOperationsupdate in interface ReactiveRepositoryOperationsT - The generic typeoperation - The entity operation@NonNull
public <T> org.reactivestreams.Publisher<T> persistAll(@NonNull
BatchOperation<T> operation)
ReactiveRepositoryOperationspersistAll in interface ReactiveRepositoryOperationsT - The generic typeoperation - The batch operation@NonNull
public org.reactivestreams.Publisher<java.lang.Number> executeUpdate(@NonNull
PreparedQuery<?,java.lang.Number> preparedQuery)
ReactiveRepositoryOperationsexecuteUpdate in interface ReactiveRepositoryOperationspreparedQuery - The prepared query@NonNull public <T> org.reactivestreams.Publisher<java.lang.Number> deleteAll(BatchOperation<T> operation)
ReactiveRepositoryOperationsdeleteAll in interface ReactiveRepositoryOperationsT - The generic typeoperation - The batch operation