Class StatementLogSqlSession
java.lang.Object
org.camunda.bpm.qa.performance.engine.util.DelegatingSqlSession
org.camunda.bpm.qa.performance.engine.sqlstatementlog.StatementLogSqlSession
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.ibatis.session.SqlSession
This SqlSession wraps an actual SqlSession and logs executed sql statements. (Calls to the delete*, update*, select*, insert* methods.)
- Author:
- Daniel Meyer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static ThreadLocal<List<StatementLogSqlSession.SqlStatementLog>>Fields inherited from class org.camunda.bpm.qa.performance.engine.util.DelegatingSqlSession
wrappedSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintintprotected voidlogStatement(StatementLogSqlSession.SqlStatementType type, Object parameters, String statement, long duration) voidvoidselect(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler handler) void<E> List<E>selectList(String statement) <E> List<E>selectList(String statement, Object parameter) <E> List<E>selectList(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds) <K,V> Map<K, V> <K,V> Map<K, V> selectMap(String statement, Object parameter, String mapKey, org.apache.ibatis.session.RowBounds rowBounds) <K,V> Map<K, V> <T> T<T> Tstatic voidstarts logging any statements executed by the calling thread.stops logging statement executed by the current thread and returns the list of logged statements.intintMethods inherited from class org.camunda.bpm.qa.performance.engine.util.DelegatingSqlSession
clearCache, close, commit, commit, flushStatements, getConfiguration, getConnection, getMapper, rollback, rollback, selectCursor, selectCursor, selectCursor
-
Field Details
-
threadStatementLog
-
-
Constructor Details
-
StatementLogSqlSession
public StatementLogSqlSession(org.apache.ibatis.session.SqlSession wrappedSession)
-
-
Method Details
-
delete
- Specified by:
deletein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
deletein classDelegatingSqlSession
-
delete
- Specified by:
deletein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
deletein classDelegatingSqlSession
-
insert
- Specified by:
insertin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
insertin classDelegatingSqlSession
-
insert
- Specified by:
insertin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
insertin classDelegatingSqlSession
-
update
- Specified by:
updatein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
updatein classDelegatingSqlSession
-
update
- Specified by:
updatein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
updatein classDelegatingSqlSession
-
select
public void select(String statement, Object parameter, org.apache.ibatis.session.ResultHandler handler) - Specified by:
selectin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectin classDelegatingSqlSession
-
select
public void select(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler handler) - Specified by:
selectin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectin classDelegatingSqlSession
-
select
- Specified by:
selectin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectin classDelegatingSqlSession
-
selectList
- Specified by:
selectListin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectListin classDelegatingSqlSession
-
selectList
- Specified by:
selectListin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectListin classDelegatingSqlSession
-
selectList
public <E> List<E> selectList(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds) - Specified by:
selectListin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectListin classDelegatingSqlSession
-
selectMap
- Specified by:
selectMapin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectMapin classDelegatingSqlSession
-
selectMap
public <K,V> Map<K,V> selectMap(String statement, Object parameter, String mapKey, org.apache.ibatis.session.RowBounds rowBounds) - Specified by:
selectMapin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectMapin classDelegatingSqlSession
-
selectMap
- Specified by:
selectMapin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectMapin classDelegatingSqlSession
-
selectOne
- Specified by:
selectOnein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectOnein classDelegatingSqlSession
-
selectOne
- Specified by:
selectOnein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectOnein classDelegatingSqlSession
-
logStatement
protected void logStatement(StatementLogSqlSession.SqlStatementType type, Object parameters, String statement, long duration) -
stopLogging
stops logging statement executed by the current thread and returns the list of logged statements.- Returns:
- the
Listof logged sql statements
-
startLogging
public static void startLogging()starts logging any statements executed by the calling thread.
-