cn.sylinx.hbatis.ext.transaction.Transactional Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hbatis-core Show documentation
Show all versions of hbatis-core Show documentation
hbatis is a simple orm framework
The newest version!
package cn.sylinx.hbatis.ext.transaction;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* hbatis 事务注解(guice支持)
*
* @author han
*
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface Transactional {
/**
* 数据源
*
* @return
*/
String datasource() default "";
/**
*
* 事务隔离级别,默认使用全局定义事务类型
* -1:表示使用全局定义的事务类型,否则取值以下其一:
* Connection.TRANSACTION_NONE
* Connection.TRANSACTION_READ_UNCOMMITTED
* Connection.TRANSACTION_READ_COMMITTED
* Connection.TRANSACTION_REPEATABLE_READ
* Connection.TRANSACTION_SERIALIZABLE
*
*
* @return
*/
int transactionIsolation() default -1;
/**
* 是否动态数据源,是则取:DynamicDatasourceProvider.create.getDatasource()
*
* @return
*/
boolean dynamic() default false;
}