T - entity base type. See EntityStore.@ParametersAreNonnullByDefault public class ReactorEntityStore<T> extends Object implements EntityStore<T,Object>, ReactorQueryable<T>
EntityStore where all return values are Mono instances.| Constructor and Description |
|---|
ReactorEntityStore(BlockingEntityStore<T> delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the entity store.
|
<E extends T> |
count(Class<E> type)
Initiates a query to count the number of entities of a given type.
|
Selection<ReactorScalar<Integer>> |
count(QueryAttribute<?,?>... attributes)
Initiates a query to count a given selection.
|
Deletion<ReactorScalar<Integer>> |
delete()
Initiates a delete query against this data store.
|
<E extends T> |
delete(Class<E> type)
Initiates an delete query for a type.
|
<E extends T> |
delete(E entity)
Deletes the given entity from the store.
|
<E extends T> |
delete(Iterable<E> entities)
Deletes multiple entities.
|
<E extends T,K> |
findByKey(Class<E> type,
K key)
Find an entity by the given key.
|
<E extends T> |
insert(Class<E> type)
Initiates an insert operation for a type.
|
<E extends T> |
insert(E entity)
Inserts the given entity.
|
<K,E extends T> |
insert(E entity,
Class<K> keyClass)
Inserts the given entity returning the generated key after the entity is inserted.
|
<E extends T> |
insert(Iterable<E> entities)
Insert a collection of entities.
|
<K,E extends T> |
insert(Iterable<E> entities,
Class<K> keyClass)
Insert a collection of entities returning the generated keys for the inserted entities in
the order they were inserted.
|
<E extends T> |
raw(Class<E> type,
String query,
Object... parameters)
Executes a raw query against the data store mapping on to a specific entity type.
|
ReactorResult<Tuple> |
raw(String query,
Object... parameters)
Executes a raw query against the data store.
|
<E extends T> |
refresh(E entity)
Refresh the given entity.
|
<E extends T> |
refresh(E entity,
Attribute<?,?>... attributes)
Refresh the given entity on specific attributes.
|
<E extends T> |
refresh(Iterable<E> entities,
Attribute<?,?>... attributes)
Refresh the given entities on specific attributes.
|
<E extends T> |
refreshAll(E entity)
Refresh the given entity on all of its attributes including relational ones.
|
<E extends T> |
select(Class<E> type,
QueryAttribute<?,?>... attributes)
Initiates a query against a set of expression values return a specific entity type in a
Result. |
<E extends T> |
select(Class<E> type,
Set<? extends QueryAttribute<E,?>> attributes)
Initiates a query against a set of expression values return a specific entity type in a
Result. |
Selection<ReactorResult<Tuple>> |
select(Expression<?>... attributes)
Initiates a query against a set of expression values.
|
Selection<ReactorResult<Tuple>> |
select(Set<? extends Expression<?>> expressions)
Initiates a query against a set of expression values.
|
BlockingEntityStore<T> |
toBlocking() |
Update<ReactorScalar<Integer>> |
update()
Initiates an update query against this data store.
|
<E extends T> |
update(Class<E> type)
Initiates an update query for a type.
|
<E extends T> |
update(E entity)
Update the given entity.
|
<E extends T> |
update(E entity,
Attribute<?,?>... attributes)
Update specific attributes of entity regardless of any modification state.
|
<E extends T> |
update(Iterable<E> entities)
Updates a collection of entities.
|
<E extends T> |
upsert(E entity)
Upserts (insert or update) the given entity.
|
<E extends T> |
upsert(Iterable<E> entities)
Upserts (inserts or updates) a collection of entities.
|
public ReactorEntityStore(BlockingEntityStore<T> delegate)
public <E extends T> reactor.core.publisher.Mono<E> insert(E entity)
EntityStorePersistenceException may be thrown.insert in interface EntityStore<T,Object>E - entity typeentity - non null entity to insertpublic <E extends T> reactor.core.publisher.Mono<Iterable<E>> insert(Iterable<E> entities)
EntityStoreinsert in interface EntityStore<T,Object>E - entity typeentities - to insertpublic <K,E extends T> reactor.core.publisher.Mono<K> insert(E entity, Class<K> keyClass)
EntityStorePersistenceException
may be thrown.insert in interface EntityStore<T,Object>K - key typeE - entity typeentity - non null entity to insertkeyClass - key classpublic <K,E extends T> reactor.core.publisher.Mono<Iterable<K>> insert(Iterable<E> entities, Class<K> keyClass)
EntityStoreinsert in interface EntityStore<T,Object>K - key typeE - entity typeentities - to insertkeyClass - key classpublic <E extends T> reactor.core.publisher.Mono<E> update(E entity)
EntityStoreupdate in interface EntityStore<T,Object>E - entity typeentity - to updatepublic <E extends T> reactor.core.publisher.Mono<E> update(E entity, Attribute<?,?>... attributes)
EntityStoreupdate in interface EntityStore<T,Object>E - entity typeentity - to refreshattributes - attributes to update, attributes should be of type Epublic <E extends T> reactor.core.publisher.Mono<Iterable<E>> update(Iterable<E> entities)
EntityStoreupdate in interface EntityStore<T,Object>E - entity typeentities - to updatepublic <E extends T> reactor.core.publisher.Mono<E> upsert(E entity)
EntityStoreupsert in interface EntityStore<T,Object>E - entity typeentity - non null entity to insertpublic <E extends T> reactor.core.publisher.Mono<Iterable<E>> upsert(Iterable<E> entities)
EntityStoreupsert in interface EntityStore<T,Object>E - entity typeentities - to updatepublic <E extends T> reactor.core.publisher.Mono<E> refresh(E entity)
EntityStorerefresh in interface EntityStore<T,Object>E - entity typeentity - to insertpublic <E extends T> reactor.core.publisher.Mono<E> refresh(E entity, Attribute<?,?>... attributes)
EntityStorerefresh in interface EntityStore<T,Object>E - entity typeentity - to refreshattributes - attributes to refresh, attributes should be of type E
(not enforced due to erasure)public <E extends T> reactor.core.publisher.Mono<Iterable<E>> refresh(Iterable<E> entities, Attribute<?,?>... attributes)
EntityStorerefresh in interface EntityStore<T,Object>E - entity typeentities - to refreshattributes - attributes to refresh, attributes should be of type E
(not enforced due to erasure)public <E extends T> reactor.core.publisher.Mono<E> refreshAll(E entity)
EntityStorerefreshAll in interface EntityStore<T,Object>E - entity typeentity - to refreshpublic <E extends T> reactor.core.publisher.Mono<Void> delete(E entity)
EntityStoredelete in interface EntityStore<T,Object>E - entity type.entity - to deletepublic <E extends T> reactor.core.publisher.Mono<Void> delete(Iterable<E> entities)
EntityStoredelete in interface EntityStore<T,Object>E - entity typeentities - to deletepublic <E extends T,K> reactor.core.publisher.Mono<E> findByKey(Class<E> type, K key)
EntityStoreEntityCache if available may be checked first for the object. If an entity is
found in the cache it will be returned and potentially no query will be made.findByKey in interface EntityStore<T,Object>E - entity typeK - key typetype - non null entity class typekey - non null key valuepublic void close()
EntityStoreResult
instances may throw a PersistenceException.close in interface EntityStore<T,Object>close in interface AutoCloseablepublic Selection<ReactorResult<Tuple>> select(Expression<?>... attributes)
Queryablepublic Selection<ReactorResult<Tuple>> select(Set<? extends Expression<?>> expressions)
Queryablepublic Update<ReactorScalar<Integer>> update()
QueryableReturn.get() to perform the operation. The result is the number of rows
affected by the call. Note that aggregate update queries will not affect existing entity
objects in memory.public Deletion<ReactorScalar<Integer>> delete()
QueryableReturn.get() to perform the operation. The result is the number of rows
affected by the call. Note that aggregate update queries will not affect existing entity
objects in memory.public <E extends T> Selection<ReactorResult<E>> select(Class<E> type, QueryAttribute<?,?>... attributes)
QueryableResult.public <E extends T> Selection<ReactorResult<E>> select(Class<E> type, Set<? extends QueryAttribute<E,?>> attributes)
QueryableResult.public <E extends T> Insertion<ReactorResult<Tuple>> insert(Class<E> type)
QueryableReturn.get() to perform the operation. If the type has no generated key values the
result is a tuple containing a single element with the number of rows affected by the
operation. Otherwise if the type has generated keys those keys are returned as the result.public <E extends T> Update<ReactorScalar<Integer>> update(Class<E> type)
QueryableReturn.get() to perform the operation. The result is the number of rows
affected by the call. Note that aggregate update queries will not affect existing entity
objects in memory.public <E extends T> Deletion<ReactorScalar<Integer>> delete(Class<E> type)
QueryableReturn.get() to perform the operation. Note that aggregate delete queries
will not affect existing entity objects in memory or in the EntityCache associated
with the store.public <E extends T> Selection<ReactorScalar<Integer>> count(Class<E> type)
Queryablepublic Selection<ReactorScalar<Integer>> count(QueryAttribute<?,?>... attributes)
Queryablepublic ReactorResult<Tuple> raw(String query, Object... parameters)
Queryableraw in interface Queryable<T>raw in interface ReactorQueryable<T>query - raw query to executeparameters - query arguments, the number of arguments must match the number of place
holder values in the query or a PersistenceException will be
thrown.Tuple.public <E extends T> ReactorResult<E> raw(Class<E> type, String query, Object... parameters)
Queryableraw in interface Queryable<T>raw in interface ReactorQueryable<T>E - entity typetype - entity typequery - raw query to executeparameters - query arguments, the number of arguments must match the number of place
holder values in the query or a PersistenceException will be
thrown.public BlockingEntityStore<T> toBlocking()
toBlocking in interface EntityStore<T,Object>BlockingEntityStore version of this entity store. If the implementation
is already blocking may return itself.