Class SqlRecorder
java.lang.Object
com.querydsl.sql.SQLBaseListener
com.evolveum.midpoint.repo.sqlbase.querydsl.SqlLogger
com.evolveum.midpoint.repo.sqlbase.querydsl.SqlRecorder
- All Implemented Interfaces:
com.querydsl.sql.SQLDetailedListener
,com.querydsl.sql.SQLListener
Extension of
SqlLogger
that includes buffer for queries which can be inspected later.
Information to the buffer is added regardless of the logger level setting, but can be controlled
by startRecording()
and stopRecording()
methods.
Recording is off when the SQL recorder is created, only logging works.
Maximum size of the buffer is provided in the constructor, information about older queries are
discarded when the buffer is full.
Query buffer contains SQL string and string for each parameter formatted for the logging.
For instance, it contains just a preview of very long byte array, not the original value.
Logs everything on debug, including parameters as they are formatted for the buffer anyway.-
Nested Class Summary
-
Field Summary
Fields inherited from class com.evolveum.midpoint.repo.sqlbase.querydsl.SqlLogger
BYTE_ARRAY_PREVIEW_LEN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
end
(com.querydsl.sql.SQLListenerContext context) End is the right phase common to both selects and insert/updates.Returns shallow copy of the query buffer in synchronized manner.boolean
void
void
Methods inherited from class com.evolveum.midpoint.repo.sqlbase.querydsl.SqlLogger
start, valueToString
Methods inherited from class com.querydsl.sql.SQLBaseListener
exception, executed, notifyDelete, notifyDeletes, notifyInsert, notifyInserts, notifyMerge, notifyMerges, notifyQuery, notifyUpdate, notifyUpdates, preExecute, prepared, prePrepare, preRender, rendered
-
Field Details
-
LOGGER
-
-
Constructor Details
-
SqlRecorder
public SqlRecorder(int queryBufferSize)
-
-
Method Details
-
end
public void end(com.querydsl.sql.SQLListenerContext context) End is the right phase common to both selects and insert/updates. It's called after exceptions too. -
getQueryBuffer
Returns shallow copy of the query buffer in synchronized manner. -
dumpQueryBuffer
-
clearBuffer
public void clearBuffer() -
clearBufferAndStartRecording
public void clearBufferAndStartRecording() -
startRecording
public void startRecording() -
stopRecording
public void stopRecording() -
isRecording
public boolean isRecording()
-