org.mybatis.guice.transactional
Annotation Type Transactional


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Transactional

Any method or class marked with this annotation will be considered for transactionality.

Version:
$Id: Transactional.java 3641 2011-02-24 11:26:45Z simone.tripodi $

Optional Element Summary
 boolean autoCommit
          Flag to indicate the auto commit policy.
 String exceptionMessage
          A custom error message when throwing the custom exception.
 org.apache.ibatis.session.ExecutorType executorType
          Returns the constant indicating the myBatis executor type.
 boolean force
          Flag to indicate that myBatis has to force the transaction commit().
 org.apache.ibatis.session.TransactionIsolationLevel isolationLevel
          Returns the constant indicating the transaction isolation level.
 Class<? extends Throwable> rethrowExceptionsAs
          The exception re-thrown when an error occurs during the transaction.
 boolean rollbackOnly
          If true, the transaction will never committed but rather rolled back, useful for testing purposes.
 

executorType

public abstract org.apache.ibatis.session.ExecutorType executorType
Returns the constant indicating the myBatis executor type.

Returns:
the constant indicating the myBatis executor type.
Default:
org.apache.ibatis.session.ExecutorType.SIMPLE

isolationLevel

public abstract org.apache.ibatis.session.TransactionIsolationLevel isolationLevel
Returns the constant indicating the transaction isolation level.

Returns:
the constant indicating the transaction isolation level.
Default:
org.apache.ibatis.session.TransactionIsolationLevel.NONE

force

public abstract boolean force
Flag to indicate that myBatis has to force the transaction commit().

Returns:
false by default, user defined otherwise.
Default:
false

autoCommit

public abstract boolean autoCommit
Flag to indicate the auto commit policy.

Returns:
false by default, user defined otherwise.
Default:
false

rethrowExceptionsAs

public abstract Class<? extends Throwable> 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

public abstract String exceptionMessage
A 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:
Formatter.format(String, Object...)
Default:
""

rollbackOnly

public abstract boolean rollbackOnly
If 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


Copyright © 2010-2011 MyBatis.org. All Rights Reserved.