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
public class StatementLogSqlSession extends DelegatingSqlSession
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 Classes Modifier and Type Class Description static classStatementLogSqlSession.SqlStatementLogstatic classStatementLogSqlSession.SqlStatementType
-
Field Summary
Fields Modifier and Type Field Description protected static ThreadLocal<List<StatementLogSqlSession.SqlStatementLog>>threadStatementLog-
Fields inherited from class org.camunda.bpm.qa.performance.engine.util.DelegatingSqlSession
wrappedSession
-
-
Constructor Summary
Constructors Constructor Description StatementLogSqlSession(org.apache.ibatis.session.SqlSession wrappedSession)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdelete(String statement)intdelete(String statement, Object parameter)intinsert(String statement)intinsert(String statement, Object paremeter)protected voidlogStatement(StatementLogSqlSession.SqlStatementType type, Object parameters, String statement, long duration)voidselect(String statement, Object parameter, org.apache.ibatis.session.ResultHandler handler)voidselect(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler handler)voidselect(String statement, org.apache.ibatis.session.ResultHandler handler)<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>selectMap(String statement, Object parameter, String mapKey)<K,V>
Map<K,V>selectMap(String statement, Object parameter, String mapKey, org.apache.ibatis.session.RowBounds rowBounds)<K,V>
Map<K,V>selectMap(String statement, String mapKey)<T> TselectOne(String statement)<T> TselectOne(String statement, Object parameter)static voidstartLogging()starts logging any statements executed by the calling thread.static List<StatementLogSqlSession.SqlStatementLog>stopLogging()stops logging statement executed by the current thread and returns the list of logged statements.intupdate(String statement)intupdate(String statement, Object parameter)-
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 Detail
-
threadStatementLog
protected static ThreadLocal<List<StatementLogSqlSession.SqlStatementLog>> threadStatementLog
-
-
Method Detail
-
delete
public int delete(String statement)
- Specified by:
deletein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
deletein classDelegatingSqlSession
-
delete
public int delete(String statement, Object parameter)
- Specified by:
deletein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
deletein classDelegatingSqlSession
-
insert
public int insert(String statement)
- Specified by:
insertin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
insertin classDelegatingSqlSession
-
insert
public int insert(String statement, Object paremeter)
- Specified by:
insertin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
insertin classDelegatingSqlSession
-
update
public int update(String statement)
- Specified by:
updatein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
updatein classDelegatingSqlSession
-
update
public int update(String statement, Object parameter)
- 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
public void select(String statement, org.apache.ibatis.session.ResultHandler handler)
- Specified by:
selectin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectin classDelegatingSqlSession
-
selectList
public <E> List<E> selectList(String statement)
- Specified by:
selectListin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectListin classDelegatingSqlSession
-
selectList
public <E> List<E> selectList(String statement, Object parameter)
- 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
public <K,V> Map<K,V> selectMap(String statement, Object parameter, String mapKey)
- 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
public <K,V> Map<K,V> selectMap(String statement, String mapKey)
- Specified by:
selectMapin interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectMapin classDelegatingSqlSession
-
selectOne
public <T> T selectOne(String statement)
- Specified by:
selectOnein interfaceorg.apache.ibatis.session.SqlSession- Overrides:
selectOnein classDelegatingSqlSession
-
selectOne
public <T> T selectOne(String statement, Object parameter)
- 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
public static List<StatementLogSqlSession.SqlStatementLog> 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.
-
-