Search in sources :

Example 1 with BatchExecutor

use of org.apache.ibatis.executor.BatchExecutor in project mybatis-3 by mybatis.

the class Configuration method newExecutor.

public Executor newExecutor(Transaction transaction, ExecutorType executorType) {
    executorType = executorType == null ? defaultExecutorType : executorType;
    executorType = executorType == null ? ExecutorType.SIMPLE : executorType;
    Executor executor;
    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;
}
Also used : BatchExecutor(org.apache.ibatis.executor.BatchExecutor) BatchExecutor(org.apache.ibatis.executor.BatchExecutor) ReuseExecutor(org.apache.ibatis.executor.ReuseExecutor) CachingExecutor(org.apache.ibatis.executor.CachingExecutor) SimpleExecutor(org.apache.ibatis.executor.SimpleExecutor) Executor(org.apache.ibatis.executor.Executor) CachingExecutor(org.apache.ibatis.executor.CachingExecutor) ReuseExecutor(org.apache.ibatis.executor.ReuseExecutor) SimpleExecutor(org.apache.ibatis.executor.SimpleExecutor)

Aggregations

BatchExecutor (org.apache.ibatis.executor.BatchExecutor)1 CachingExecutor (org.apache.ibatis.executor.CachingExecutor)1 Executor (org.apache.ibatis.executor.Executor)1 ReuseExecutor (org.apache.ibatis.executor.ReuseExecutor)1 SimpleExecutor (org.apache.ibatis.executor.SimpleExecutor)1