Package org.apache.ibatis.executor
Class BaseExecutor
java.lang.Object
org.apache.ibatis.executor.BaseExecutor
- All Implemented Interfaces:
Executor
- Direct Known Subclasses:
BatchExecutor,ReuseExecutor,SimpleExecutor
- Author:
- Clinton Begin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Configurationprotected ConcurrentLinkedQueue<org.apache.ibatis.executor.BaseExecutor.DeferredLoad> protected PerpetualCacheprotected PerpetualCacheprotected intprotected Transactionprotected ExecutorFields inherited from interface org.apache.ibatis.executor.Executor
NO_RESULT_HANDLER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseExecutor(Configuration configuration, Transaction transaction) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyTransactionTimeout(Statement statement) Apply a transaction timeout.voidvoidclose(boolean forceRollback) protected voidcloseStatement(Statement statement) voidcommit(boolean required) createCacheKey(MappedStatement ms, Object parameterObject, RowBounds rowBounds, BoundSql boundSql) voiddeferLoad(MappedStatement ms, MetaObject resultObject, String property, CacheKey key, Class<?> targetType) protected abstract List<BatchResult> doFlushStatements(boolean isRollback) protected abstract <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) protected abstract <E> Cursor<E> doQueryCursor(MappedStatement ms, Object parameter, RowBounds rowBounds, BoundSql boundSql) protected abstract intdoUpdate(MappedStatement ms, Object parameter) flushStatements(boolean isRollBack) protected ConnectiongetConnection(Log statementLog) booleanisCached(MappedStatement ms, CacheKey key) booleanisClosed()<E> List<E> query(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler) <E> List<E> query(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, CacheKey key, BoundSql boundSql) <E> Cursor<E> queryCursor(MappedStatement ms, Object parameter, RowBounds rowBounds) voidrollback(boolean required) voidsetExecutorWrapper(Executor wrapper) intupdate(MappedStatement ms, Object parameter)
-
Field Details
-
transaction
-
wrapper
-
deferredLoads
-
localCache
-
localOutputParameterCache
-
configuration
-
queryStack
protected int queryStack
-
-
Constructor Details
-
BaseExecutor
-
-
Method Details
-
getTransaction
- Specified by:
getTransactionin interfaceExecutor
-
close
public void close(boolean forceRollback) -
isClosed
public boolean isClosed() -
update
- Specified by:
updatein interfaceExecutor- Throws:
SQLException
-
flushStatements
- Specified by:
flushStatementsin interfaceExecutor- Throws:
SQLException
-
flushStatements
- Throws:
SQLException
-
query
public <E> List<E> query(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler) throws SQLException - Specified by:
queryin interfaceExecutor- Throws:
SQLException
-
query
public <E> List<E> query(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, CacheKey key, BoundSql boundSql) throws SQLException - Specified by:
queryin interfaceExecutor- Throws:
SQLException
-
queryCursor
public <E> Cursor<E> queryCursor(MappedStatement ms, Object parameter, RowBounds rowBounds) throws SQLException - Specified by:
queryCursorin interfaceExecutor- Throws:
SQLException
-
deferLoad
public void deferLoad(MappedStatement ms, MetaObject resultObject, String property, CacheKey key, Class<?> targetType) -
createCacheKey
public CacheKey createCacheKey(MappedStatement ms, Object parameterObject, RowBounds rowBounds, BoundSql boundSql) - Specified by:
createCacheKeyin interfaceExecutor
-
isCached
-
commit
- Specified by:
commitin interfaceExecutor- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceExecutor- Throws:
SQLException
-
clearLocalCache
public void clearLocalCache()- Specified by:
clearLocalCachein interfaceExecutor
-
doUpdate
- Throws:
SQLException
-
doFlushStatements
- Throws:
SQLException
-
doQuery
protected abstract <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException - Throws:
SQLException
-
doQueryCursor
protected abstract <E> Cursor<E> doQueryCursor(MappedStatement ms, Object parameter, RowBounds rowBounds, BoundSql boundSql) throws SQLException - Throws:
SQLException
-
closeStatement
-
applyTransactionTimeout
Apply a transaction timeout.- Parameters:
statement- a current statement- Throws:
SQLException- if a database access error occurs, this method is called on a closedStatement- Since:
- 3.4.0
- See Also:
-
getConnection
- Throws:
SQLException
-
setExecutorWrapper
- Specified by:
setExecutorWrapperin interfaceExecutor
-