Package org.mybatis.guice.transactional
Annotation Type Transactional
Any method marked with this annotation will be considered for transactionality.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The TxType element of the annotation indicates whether a bean method is to be executed within a transaction context where the values provide the following corresponding behavior. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Deprecated.Users that intend auto commit can achieve it by simply not using @TransactionalA custom error message when throwing the custom exception.org.apache.ibatis.session.ExecutorType
Returns the constant indicating the myBatis executor type.boolean
Flag to indicate that myBatis has to force the transactioncommit().
Returns the constant indicating the transaction isolation level.org.apache.ibatis.session.TransactionIsolationLevel
Deprecated.useisolation()
instead, setting this property has no effect.The exception re-thrown when an error occurs during the transaction.boolean
If true, the transaction will never committed but rather rolled back, useful for testing purposes.The TxType element of the Transactional annotation indicates whether a bean method is to be executed within a transaction context.
-
Element Details
-
executorType
org.apache.ibatis.session.ExecutorType executorTypeReturns the constant indicating the myBatis executor type.- Returns:
- the constant indicating the myBatis executor type.
- Default:
SIMPLE
-
isolation
Isolation isolationReturns the constant indicating the transaction isolation level.- Returns:
- the constant indicating the transaction isolation level.
- Default:
DEFAULT
-
isolationLevel
Deprecated.useisolation()
instead, setting this property has no effect.Returns the constant indicating the transaction isolation level.- Returns:
- the constant indicating the transaction isolation level.
- Default:
NONE
-
force
boolean forceFlag to indicate that myBatis has to force the transactioncommit().
- Returns:
- false by default, user defined otherwise.
- Default:
false
-
autoCommit
Deprecated.Users that intend auto commit can achieve it by simply not using @TransactionalFlag to indicate the auto commit policy.- Returns:
- false by default, user defined otherwise.
- Default:
false
-
rethrowExceptionsAs
The exception re-thrown when an error occurs during the transaction.- Returns:
- the exception re-thrown when an error occurs during the transaction.
- Default:
java.lang.Exception.class
-
exceptionMessage
String exceptionMessageA custom error message when throwing the custom exception.It supports java.util.Formatter place holders, intercepted method arguments will be used as message format arguments.
- Returns:
- a custom error message when throwing the custom exception.
- See Also:
- Default:
""
-
rollbackOnly
boolean rollbackOnlyIf true, the transaction will never committed but rather rolled back, useful for testing purposes.This parameter is false by default.
- Returns:
- if true, the transaction will never committed but rather rolled back, useful for testing purposes.
- Default:
false
-
value
Transactional.TxType valueThe TxType element of the Transactional annotation indicates whether a bean method is to be executed within a transaction context.- Returns:
- the tx type
- Default:
REQUIRED
-