/* Org. apache. ibatis. session. Configuration method */ Public ParameterHandler newParameterHandler (MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql ){ ParameterHandler parameterHandler = mappedStatement. getLang (). createParameterHandler (mappedStatement, parameterObject, boundSql ); /* Intercept ParameterHandler */ ParameterHandler = (ParameterHandler) interceptorChain. pluginAll (parameterHandler ); Return parameterHandler; } Public ResultSetHandler newResultSetHandler (Executor executor, MappedStatement mappedStatement, RowBounds rowBounds, ParameterHandler parameterHandler, ResultHandler resultHandler, BoundSql boundSql ){ ResultSetHandler resultSetHandler = new DefaultResultSetHandler (executor, mappedStatement, parameterHandler, resultHandler, boundSql, rowBounds ); /* Intercept ResultSetHandler */ ResultSetHandler = (ResultSetHandler) interceptorChain. pluginAll (resultSetHandler ); Return resultSetHandler; } Public StatementHandler newStatementHandler (Executor executor, MappedStatement mappedStatement, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql ){ StatementHandler statementHandler = new RoutingStatementHandler (executor, mappedStatement, parameterObject, rowBounds, resultHandler, boundSql ); /* Intercept StatementHandler */ StatementHandler = (StatementHandler) interceptorChain. pluginAll (statementHandler ); Return statementHandler; } Public Executor newExecutor (Transaction transaction, ExecutorType executorType ){ ExecutorType = null? DefaultExecutorType: 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 ); } /* Intercept Executor */ Executor = (Executor) interceptorChain. pluginAll (executor ); Return executor; } |