
com.penglecode.mybatis.ex.ExConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mybatis-ex Show documentation
Show all versions of mybatis-ex Show documentation
mybatis的自定义扩展。
版本1.0.0 支持mybatis 3.2|3.3版本
版本1.0.1 支持mybatis 3.4版本
The newest version!
package com.penglecode.mybatis.ex;
import org.apache.ibatis.binding.MapperRegistry;
import org.apache.ibatis.executor.CachingExecutor;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.transaction.Transaction;
/**
* 针对DynamicExecutor扩展的Configuration
*
* @author pengpeng
* @date 2014年7月6日 下午10:23:47
* @version 1.0
*/
public class ExConfiguration extends Configuration {
protected final MapperRegistry mapperRegistry = new MapperRegistry(this);
public Executor newExecutor(Transaction transaction, ExecutorType executorType) {
Executor executor = new DynamicExecutor(this, transaction, executorType);
if (cacheEnabled) {
executor = new CachingExecutor(executor);
}
executor = (Executor) interceptorChain.pluginAll(executor);
return executor;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy