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 2274 2010-08-07 16:47:12Z 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.
 

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.text.MessageFormat place holders, intercepted method arguments will be used as message format arguments.

Returns:
a custom error message when throwing the custom exception.
See Also:
MessageFormat.format(String, Object...)
Default:
""


Copyright © 2010 MyBatis.org. All Rights Reserved.