@EachBean(value=io.r2dbc.spi.ConnectionFactory.class) public class DefaultR2dbcRepositoryOperations extends io.micronaut.data.jdbc.operations.AbstractSqlRepositoryOperations<io.r2dbc.spi.Row,io.r2dbc.spi.Statement> implements R2dbcRepositoryOperations, R2dbcOperations, io.micronaut.transaction.reactive.ReactiveTransactionOperations<io.r2dbc.spi.Connection>
Modifier | Constructor and Description |
---|---|
protected |
DefaultR2dbcRepositoryOperations(java.lang.String dataSourceName,
io.r2dbc.spi.ConnectionFactory connectionFactory,
java.util.List<io.micronaut.http.codec.MediaTypeCodec> mediaTypeCodecList,
io.micronaut.data.runtime.date.DateTimeProvider<?> dateTimeProvider,
io.micronaut.context.ApplicationContext applicationContext)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
io.micronaut.data.operations.async.AsyncRepositoryOperations |
async() |
io.r2dbc.spi.ConnectionFactory |
connectionFactory()
Obtains the connection factory.
|
<T> long |
count(io.micronaut.data.model.runtime.PagedQuery<T> pagedQuery) |
<T> java.util.Optional<java.lang.Number> |
deleteAll(io.micronaut.data.model.runtime.BatchOperation<T> operation) |
java.util.Optional<java.lang.Number> |
executeUpdate(io.micronaut.data.model.runtime.PreparedQuery<?,java.lang.Number> preparedQuery) |
<T> boolean |
exists(io.micronaut.data.model.runtime.PreparedQuery<T,java.lang.Boolean> preparedQuery) |
<T> java.lang.Iterable<T> |
findAll(io.micronaut.data.model.runtime.PagedQuery<T> query) |
<T,R> java.lang.Iterable<R> |
findAll(io.micronaut.data.model.runtime.PreparedQuery<T,R> preparedQuery) |
<T> T |
findOne(java.lang.Class<T> type,
java.io.Serializable id) |
<T,R> R |
findOne(io.micronaut.data.model.runtime.PreparedQuery<T,R> preparedQuery) |
<R> io.micronaut.data.model.Page<R> |
findPage(io.micronaut.data.model.runtime.PagedQuery<R> query) |
<T> java.util.stream.Stream<T> |
findStream(io.micronaut.data.model.runtime.PagedQuery<T> query) |
<T,R> java.util.stream.Stream<R> |
findStream(io.micronaut.data.model.runtime.PreparedQuery<T,R> preparedQuery) |
<T> T |
persist(io.micronaut.data.model.runtime.InsertOperation<T> operation) |
<T> java.lang.Iterable<T> |
persistAll(io.micronaut.data.model.runtime.BatchOperation<T> operation) |
io.micronaut.data.operations.reactive.ReactiveRepositoryOperations |
reactive() |
protected int |
shiftIndex(int i) |
<T> T |
update(io.micronaut.data.model.runtime.UpdateOperation<T> operation) |
<T> org.reactivestreams.Publisher<T> |
withConnection(java.util.function.Function<io.r2dbc.spi.Connection,org.reactivestreams.Publisher<T>> handler)
Execute the given handler with a new connection.
|
<T> org.reactivestreams.Publisher<T> |
withTransaction(io.micronaut.transaction.reactive.ReactiveTransactionStatus<io.r2dbc.spi.Connection> status,
io.micronaut.transaction.reactive.ReactiveTransactionOperations.TransactionalCallback<io.r2dbc.spi.Connection,T> handler)
Execute the given handler with an existing transaction status.
|
<T> reactor.core.publisher.Flux<T> |
withTransaction(io.micronaut.transaction.TransactionDefinition definition,
io.micronaut.transaction.reactive.ReactiveTransactionOperations.TransactionalCallback<io.r2dbc.spi.Connection,T> handler) |
getEntity, getIdReader, isSqlServerWithoutOrderBy, prepareStatement, resolveAssociationInsert, resolveEntityInsert, resolveEntityUpdate, resolveInsert, setInsertParameters, setStatementParameter, sizeOf, sortById
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@Internal protected DefaultR2dbcRepositoryOperations(@Parameter java.lang.String dataSourceName, io.r2dbc.spi.ConnectionFactory connectionFactory, java.util.List<io.micronaut.http.codec.MediaTypeCodec> mediaTypeCodecList, @NonNull io.micronaut.data.runtime.date.DateTimeProvider<?> dateTimeProvider, io.micronaut.context.ApplicationContext applicationContext)
dataSourceName
- The data source nameconnectionFactory
- The associated connection factorymediaTypeCodecList
- The media type codec listdateTimeProvider
- The date time providerapplicationContext
- The bean contextprotected int shiftIndex(int i)
shiftIndex
in class io.micronaut.data.jdbc.operations.AbstractSqlRepositoryOperations<io.r2dbc.spi.Row,io.r2dbc.spi.Statement>
@NonNull public io.micronaut.data.operations.reactive.ReactiveRepositoryOperations reactive()
reactive
in interface io.micronaut.data.operations.reactive.ReactiveCapableRepository
@Nullable public <T,R> R findOne(@NonNull io.micronaut.data.model.runtime.PreparedQuery<T,R> preparedQuery)
findOne
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public <T,R> java.lang.Iterable<R> findAll(@NonNull io.micronaut.data.model.runtime.PreparedQuery<T,R> preparedQuery)
findAll
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public <T,R> java.util.stream.Stream<R> findStream(@NonNull io.micronaut.data.model.runtime.PreparedQuery<T,R> preparedQuery)
findStream
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public <T> T persist(@NonNull io.micronaut.data.model.runtime.InsertOperation<T> operation)
persist
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public <T> T update(@NonNull io.micronaut.data.model.runtime.UpdateOperation<T> operation)
update
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public <T> java.lang.Iterable<T> persistAll(@NonNull io.micronaut.data.model.runtime.BatchOperation<T> operation)
persistAll
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public java.util.Optional<java.lang.Number> executeUpdate(@NonNull io.micronaut.data.model.runtime.PreparedQuery<?,java.lang.Number> preparedQuery)
executeUpdate
in interface io.micronaut.data.operations.RepositoryOperations
public <T> java.util.Optional<java.lang.Number> deleteAll(@NonNull io.micronaut.data.model.runtime.BatchOperation<T> operation)
deleteAll
in interface io.micronaut.data.operations.RepositoryOperations
public <T> boolean exists(@NonNull io.micronaut.data.model.runtime.PreparedQuery<T,java.lang.Boolean> preparedQuery)
exists
in interface io.micronaut.data.operations.RepositoryOperations
public <R> io.micronaut.data.model.Page<R> findPage(@NonNull io.micronaut.data.model.runtime.PagedQuery<R> query)
findPage
in interface io.micronaut.data.operations.RepositoryOperations
@Nullable public <T> T findOne(@NonNull java.lang.Class<T> type, @NonNull java.io.Serializable id)
findOne
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public <T> java.lang.Iterable<T> findAll(@NonNull io.micronaut.data.model.runtime.PagedQuery<T> query)
findAll
in interface io.micronaut.data.operations.RepositoryOperations
public <T> long count(io.micronaut.data.model.runtime.PagedQuery<T> pagedQuery)
count
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public <T> java.util.stream.Stream<T> findStream(@NonNull io.micronaut.data.model.runtime.PagedQuery<T> query)
findStream
in interface io.micronaut.data.operations.RepositoryOperations
@NonNull public io.micronaut.data.operations.async.AsyncRepositoryOperations async()
async
in interface io.micronaut.data.operations.async.AsyncCapableRepository
@NonNull public io.r2dbc.spi.ConnectionFactory connectionFactory()
R2dbcOperations
connectionFactory
in interface R2dbcOperations
@NonNull public <T> org.reactivestreams.Publisher<T> withConnection(@NonNull java.util.function.Function<io.r2dbc.spi.Connection,org.reactivestreams.Publisher<T>> handler)
R2dbcOperations
withConnection
in interface R2dbcOperations
T
- The emitted typehandler
- The handler@NonNull public <T> org.reactivestreams.Publisher<T> withTransaction(@NonNull io.micronaut.transaction.reactive.ReactiveTransactionStatus<io.r2dbc.spi.Connection> status, @NonNull io.micronaut.transaction.reactive.ReactiveTransactionOperations.TransactionalCallback<io.r2dbc.spi.Connection,T> handler)
R2dbcOperations
withTransaction
in interface R2dbcOperations
T
- The emitted typestatus
- An existing in progress transaction statushandler
- The handler@NonNull public <T> reactor.core.publisher.Flux<T> withTransaction(@NonNull io.micronaut.transaction.TransactionDefinition definition, @NonNull io.micronaut.transaction.reactive.ReactiveTransactionOperations.TransactionalCallback<io.r2dbc.spi.Connection,T> handler)
withTransaction
in interface io.micronaut.transaction.reactive.ReactiveTransactionOperations<io.r2dbc.spi.Connection>