Package io.micronaut.data.spring.tx
Class AbstractSpringTransactionOperations
java.lang.Object
io.micronaut.transaction.support.AbstractPropagatedStatusTransactionOperations<TransactionStatus<Connection>,Connection>
io.micronaut.data.spring.tx.AbstractSpringTransactionOperations
- All Implemented Interfaces:
TransactionOperations<Connection>
- Direct Known Subclasses:
SpringJdbcTransactionOperations
@Internal
public abstract class AbstractSpringTransactionOperations
extends AbstractPropagatedStatusTransactionOperations<TransactionStatus<Connection>,Connection>
Adds Spring Transaction management capability to Micronaut Data.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractSpringTransactionOperations
(org.springframework.transaction.PlatformTransactionManager transactionManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected <R> R
doExecute
(TransactionDefinition definition, TransactionCallback<Connection, R> callback) Do execute in transaction.<R> R
executeRead
(@NonNull TransactionCallback<Connection, R> callback) Execute a read-only transaction within the context of the function.<R> R
executeWrite
(@NonNull TransactionCallback<Connection, R> callback) Execute a default transaction within the context of the function.Methods inherited from class io.micronaut.transaction.support.AbstractPropagatedStatusTransactionOperations
execute, extendCurrentPropagatedContext, findTransactionStatus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.transaction.TransactionOperations
getConnection, hasConnection
-
Constructor Details
-
AbstractSpringTransactionOperations
protected AbstractSpringTransactionOperations(org.springframework.transaction.PlatformTransactionManager transactionManager)
-
-
Method Details
-
executeRead
Description copied from interface:TransactionOperations
Execute a read-only transaction within the context of the function.- Type Parameters:
R
- The result- Parameters:
callback
- The call back- Returns:
- The result
-
executeWrite
Description copied from interface:TransactionOperations
Execute a default transaction within the context of the function.- Type Parameters:
R
- The result- Parameters:
callback
- The call back- Returns:
- The result
-
doExecute
protected <R> R doExecute(TransactionDefinition definition, TransactionCallback<Connection, R> callback) Description copied from class:AbstractPropagatedStatusTransactionOperations
Do execute in transaction.- Specified by:
doExecute
in classAbstractPropagatedStatusTransactionOperations<TransactionStatus<Connection>,
Connection> - Type Parameters:
R
- The result type- Parameters:
definition
- The transaction definitioncallback
- The callback- Returns:
- The result
-