public final class MockQueryExecutionInfo extends Object implements QueryExecutionInfo
QueryExecutionInfo for testing.| Modifier and Type | Class and Description |
|---|---|
static class |
MockQueryExecutionInfo.Builder |
| Modifier and Type | Method and Description |
|---|---|
static MockQueryExecutionInfo.Builder |
builder()
Provides a builder for
MockQueryExecutionInfo. |
static MockQueryExecutionInfo |
empty()
Provide an empty
MockMethodExecutionInfo. |
int |
getBatchSize()
Get the size of the batch query.
|
int |
getBindingsSize()
Get the number of the binding.
|
ConnectionInfo |
getConnectionInfo()
Get the associated
ConnectionInfo. |
Object |
getCurrentMappedResult()
Mapped query result available for each-query-result-callback(
ProxyExecutionListener.eachQueryResult(QueryExecutionInfo)). |
int |
getCurrentResultCount()
Represent Nth
Result. |
Duration |
getExecuteDuration()
Get the time that took queries to execute.
|
Method |
getMethod()
Get the invoked query execution
Method. |
Object[] |
getMethodArgs()
Get the arguments of the invocation.
|
ProxyEventType |
getProxyEventType()
Get the proxy event type for query execution.
|
List<QueryInfo> |
getQueries()
Get the list of
QueryInfo. |
long |
getThreadId()
Get the currently executed thread ID.
|
String |
getThreadName()
Get the currently executed thread name.
|
Throwable |
getThrowable()
Get the thrown exception.
|
ExecutionType |
getType()
Get the type of query execution.
|
ValueStore |
getValueStore()
Retrieve
ValueStore which is associated to the scope of before/after method execution. |
boolean |
isSuccess()
Indicate whether the query execution was successful or not.
|
public static MockQueryExecutionInfo.Builder builder()
MockQueryExecutionInfo.public static MockQueryExecutionInfo empty()
MockMethodExecutionInfo.MockMethodExecutionInfo.public Method getMethod()
QueryExecutionInfoMethod.getMethod in interface QueryExecutionInfopublic Object[] getMethodArgs()
QueryExecutionInfonull when method is invoked with no argument.getMethodArgs in interface QueryExecutionInfonull if the invoked method did not take any argumentspublic Throwable getThrowable()
QueryExecutionInfoProxyExecutionListener.beforeQuery(QueryExecutionInfo) callback or query execution
did't throw any error, this returns null.getThrowable in interface QueryExecutionInfopublic ConnectionInfo getConnectionInfo()
QueryExecutionInfoConnectionInfo.getConnectionInfo in interface QueryExecutionInfopublic boolean isSuccess()
QueryExecutionInfoPublisher
returned from Statement.execute() either received completion
or at least one element is emitted regardless of it has received cancellation.isSuccess in interface QueryExecutionInfopublic int getBatchSize()
QueryExecutionInfoBatch.add(String).getBatchSize in interface QueryExecutionInfopublic List<QueryInfo> getQueries()
QueryExecutionInfoQueryInfo.getQueries in interface QueryExecutionInfonull.public ExecutionType getType()
QueryExecutionInfogetType in interface QueryExecutionInfopublic int getBindingsSize()
QueryExecutionInfoStatement.add().getBindingsSize in interface QueryExecutionInfopublic Duration getExecuteDuration()
QueryExecutionInfo
Duration is only populated in appropriate phase.
(e.g.: ProxyExecutionListener.afterQuery(QueryExecutionInfo))
getExecuteDuration in interface QueryExecutionInfopublic String getThreadName()
QueryExecutionInfogetThreadName in interface QueryExecutionInfopublic long getThreadId()
QueryExecutionInfogetThreadId in interface QueryExecutionInfopublic ProxyEventType getProxyEventType()
QueryExecutionInfogetProxyEventType in interface QueryExecutionInfoProxyEventType.BEFORE_QUERY, ProxyEventType.AFTER_QUERY,
or ProxyEventType.EACH_QUERY_RESULTpublic int getCurrentResultCount()
QueryExecutionInfoResult.
On each query result callback(ProxyExecutionListener.eachQueryResult(QueryExecutionInfo)),
this value indicates Nth Result starting from 1.
(1st query result, 2nd query result, 3rd, 4th,...).
This returns 0 for before query execution(ProxyExecutionListener.beforeQuery(QueryExecutionInfo)).
For after query execution(ProxyExecutionListener.afterQuery(QueryExecutionInfo)), this returns
total number of Result returned by this query execution.getCurrentResultCount in interface QueryExecutionInfopublic Object getCurrentMappedResult()
QueryExecutionInfoProxyExecutionListener.eachQueryResult(QueryExecutionInfo)).
For before and after query execution(ProxyExecutionListener.beforeQuery(QueryExecutionInfo)
and ProxyExecutionListener.afterQuery(QueryExecutionInfo)), this returns null.getCurrentMappedResult in interface QueryExecutionInfopublic ValueStore getValueStore()
QueryExecutionInfoValueStore which is associated to the scope of before/after method execution.
Mainly used for passing values between ProxyExecutionListener.beforeQuery(QueryExecutionInfo) and
ProxyExecutionListener.afterQuery(QueryExecutionInfo).getValueStore in interface QueryExecutionInfoCopyright © 2025. All rights reserved.