public interface R2dbcEntityOperations extends FluentR2dbcOperations
R2dbcEntityTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be
mocked or stubbed.DatabaseClientReactiveSelectOperation.ReactiveSelect<T>, ReactiveSelectOperation.SelectWithProjection<T>, ReactiveSelectOperation.SelectWithQuery<T>, ReactiveSelectOperation.SelectWithTable<T>, ReactiveSelectOperation.TerminatingSelect<T>ReactiveInsertOperation.InsertWithTable<T>, ReactiveInsertOperation.ReactiveInsert<T>, ReactiveInsertOperation.TerminatingInsert<T>ReactiveUpdateOperation.ReactiveUpdate, ReactiveUpdateOperation.TerminatingUpdate, ReactiveUpdateOperation.UpdateWithQuery, ReactiveUpdateOperation.UpdateWithTableReactiveDeleteOperation.DeleteWithQuery, ReactiveDeleteOperation.DeleteWithTable, ReactiveDeleteOperation.ReactiveDelete, ReactiveDeleteOperation.TerminatingDelete| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<Long> |
count(org.springframework.data.relational.core.query.Query query,
Class<?> entityClass)
Returns the number of rows for the given entity class applying
Query. |
reactor.core.publisher.Mono<Integer> |
delete(org.springframework.data.relational.core.query.Query query,
Class<?> entityClass)
Remove entities (rows)/columns from the table by
Query. |
<T> reactor.core.publisher.Mono<T> |
delete(T entity)
Delete the given entity and emit the entity if the delete was applied.
|
reactor.core.publisher.Mono<Boolean> |
exists(org.springframework.data.relational.core.query.Query query,
Class<?> entityClass)
Determine whether the result for
entityClass Query yields at least one row. |
DatabaseClient |
getDatabaseClient()
Expose the underlying
DatabaseClient to allow SQL operations. |
<T> reactor.core.publisher.Mono<T> |
insert(T entity)
Insert the given entity and emit the entity if the insert was applied.
|
<T> reactor.core.publisher.Flux<T> |
select(org.springframework.data.relational.core.query.Query query,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items to a stream of entities. |
<T> reactor.core.publisher.Mono<T> |
selectOne(org.springframework.data.relational.core.query.Query query,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting item to an entity. |
reactor.core.publisher.Mono<Integer> |
update(org.springframework.data.relational.core.query.Query query,
org.springframework.data.relational.core.query.Update update,
Class<?> entityClass)
Update the queried entities and return true if the update was applied.
|
<T> reactor.core.publisher.Mono<T> |
update(T entity)
Update the given entity and emit the entity if the update was applied.
|
selectinsertupdatedeleteDatabaseClient getDatabaseClient()
DatabaseClient to allow SQL operations.DatabaseClient.DatabaseClientreactor.core.publisher.Mono<Long> count(org.springframework.data.relational.core.query.Query query, Class<?> entityClass) throws DataAccessException
Query. This overridden method allows users
to further refine the selection Query using a Query predicate to determine how many entities of the given
type match the Query.query - user-defined count Query to execute; must not be null.entityClass - type of the entity; must not be null.DataAccessException - if any problem occurs while executing the query.reactor.core.publisher.Mono<Boolean> exists(org.springframework.data.relational.core.query.Query query, Class<?> entityClass) throws DataAccessException
entityClass Query yields at least one row.query - user-defined exists Query to execute; must not be null.entityClass - type of the entity; must not be null.DataAccessException - if any problem occurs while executing the query.<T> reactor.core.publisher.Flux<T> select(org.springframework.data.relational.core.query.Query query,
Class<T> entityClass)
throws DataAccessException
SELECT query and convert the resulting items to a stream of entities.query - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<T> selectOne(org.springframework.data.relational.core.query.Query query,
Class<T> entityClass)
throws DataAccessException
SELECT query and convert the resulting item to an entity.query - must not be null.entityClass - The entity type must not be null.Mono.empty().DataAccessException - if there is any problem issuing the execution.reactor.core.publisher.Mono<Integer> update(org.springframework.data.relational.core.query.Query query, org.springframework.data.relational.core.query.Update update, Class<?> entityClass) throws DataAccessException
query - must not be null.update - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.reactor.core.publisher.Mono<Integer> delete(org.springframework.data.relational.core.query.Query query, Class<?> entityClass) throws DataAccessException
Query.query - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<T> insert(T entity)
throws DataAccessException
entity - The entity to insert, must not be null.DataAccessException - if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<T> update(T entity)
throws DataAccessException
entity - The entity to update, must not be null.DataAccessException - if there is any problem issuing the execution.TransientDataAccessResourceException - if the update did not affect any rows.<T> reactor.core.publisher.Mono<T> delete(T entity)
throws DataAccessException
entity - must not be null.DataAccessException - if there is any problem issuing the execution.Copyright © 2018–2020 Pivotal Software, Inc.. All rights reserved.