Example usage for org.apache.ibatis.executor CachingExecutor CachingExecutor

List of usage examples for org.apache.ibatis.executor CachingExecutor CachingExecutor

Introduction

In this page you can find the example usage for org.apache.ibatis.executor CachingExecutor CachingExecutor.

Prototype

public CachingExecutor(Executor delegate) 

Source Link

Usage

From source file:com.dmm.framework.basedb.apache.ibatis.session.Configuration.java

License:Apache License

public Executor newExecutor(Transaction transaction, ExecutorType executorType) {
    executorType = executorType == null ? defaultExecutorType : executorType;
    executorType = executorType == null ? ExecutorType.SIMPLE : executorType;
    Executor executor;/*from   w  w  w.java 2  s  .c  om*/
    if (ExecutorType.BATCH == executorType) {
        executor = new BatchExecutor(this, transaction);
    } else if (ExecutorType.REUSE == executorType) {
        executor = new ReuseExecutor(this, transaction);
    } else {
        executor = new SimpleExecutor(this, transaction);
    }
    if (cacheEnabled) {
        executor = new CachingExecutor(executor);
    }
    executor = (Executor) interceptorChain.pluginAll(executor);
    return executor;
}