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
Modifier and TypeClassDescriptionstatic class
static enum
-
Field Summary
Modifier and TypeFieldDescriptionprotected static ThreadLocal<List<StatementLogSqlSession.SqlStatementLog>>
Fields inherited from class org.camunda.bpm.qa.performance.engine.util.DelegatingSqlSession
wrappedSession
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
int
int
protected void
logStatement
(StatementLogSqlSession.SqlStatementType type, Object parameters, String statement, long duration) void
void
select
(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> T
static void
starts logging any statements executed by the calling thread.stops logging statement executed by the current thread and returns the list of logged statements.int
int
Methods 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:
delete
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
delete
in classDelegatingSqlSession
-
delete
- Specified by:
delete
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
delete
in classDelegatingSqlSession
-
insert
- Specified by:
insert
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
insert
in classDelegatingSqlSession
-
insert
- Specified by:
insert
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
insert
in classDelegatingSqlSession
-
update
- Specified by:
update
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
update
in classDelegatingSqlSession
-
update
- Specified by:
update
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
update
in classDelegatingSqlSession
-
select
public void select(String statement, Object parameter, org.apache.ibatis.session.ResultHandler handler) - Specified by:
select
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
select
in classDelegatingSqlSession
-
select
public void select(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler handler) - Specified by:
select
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
select
in classDelegatingSqlSession
-
select
- Specified by:
select
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
select
in classDelegatingSqlSession
-
selectList
- Specified by:
selectList
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
selectList
in classDelegatingSqlSession
-
selectList
- Specified by:
selectList
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
selectList
in classDelegatingSqlSession
-
selectList
public <E> List<E> selectList(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds) - Specified by:
selectList
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
selectList
in classDelegatingSqlSession
-
selectMap
- Specified by:
selectMap
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
selectMap
in classDelegatingSqlSession
-
selectMap
public <K,V> Map<K,V> selectMap(String statement, Object parameter, String mapKey, org.apache.ibatis.session.RowBounds rowBounds) - Specified by:
selectMap
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
selectMap
in classDelegatingSqlSession
-
selectMap
- Specified by:
selectMap
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
selectMap
in classDelegatingSqlSession
-
selectOne
- Specified by:
selectOne
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
selectOne
in classDelegatingSqlSession
-
selectOne
- Specified by:
selectOne
in interfaceorg.apache.ibatis.session.SqlSession
- Overrides:
selectOne
in 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
List
of logged sql statements
-
startLogging
public static void startLogging()starts logging any statements executed by the calling thread.
-