Interface QueryExecutionInfo
- All Known Implementing Classes:
MockQueryExecutionInfo
public interface QueryExecutionInfo
Holds information about a query execution.
- Author:
- Tadaya Tsuyukubo
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the size of the batch query.intReturns the number of bindings.Returns the associatedConnectionInfo.The mapped query result available for each query-result callback (ProxyExecutionListener.eachQueryResult(QueryExecutionInfo)).intRepresents the NthResult.Returns the time spent executing the query.Returns the method used for the query execution.Object[]Returns the arguments passed to the invocation.Returns the proxy event type for the query execution.Returns the list ofQueryInfo.longReturns the ID of the thread executing the query.Returns the name of the thread executing the query.Returns the exception thrown by the invocation.getType()Returns the type of query execution.Returns theValueStoreassociated with the scope of the before/after query execution.booleanReturns whether the query execution was successful.
-
Method Details
-
getMethod
-
getMethodArgs
-
getThrowable
Returns the exception thrown by the invocation. For theProxyExecutionListener.beforeQuery(QueryExecutionInfo)callback, or when the query execution did not throw any error, this returnsnull.- Returns:
- thrown exception
-
getConnectionInfo
-
isSuccess
boolean isSuccess()Returns whether the query execution was successful. This value is populated only after the query execution completes. A query execution is considered successful when thePublisherreturned fromStatement.execute()either received completion or at least one element is emitted regardless of it has received cancellation.- Returns:
- true when query has successfully executed
-
getBatchSize
int getBatchSize()Returns the size of the batch query. In other words, this is the number of calls toBatch.add(String).- Returns:
- batch size
-
getQueries
-
getType
-
getBindingsSize
int getBindingsSize()Returns the number of bindings. In other words, this is the number of calls toStatement.add().- Returns:
- size of the binding
-
getExecuteDuration
Duration getExecuteDuration()Returns the time spent executing the query.Duration is only populated in appropriate phase. (e.g.:
ProxyExecutionListener.afterQuery(QueryExecutionInfo))- Returns:
- query execution duration
-
getThreadName
-
getThreadId
long getThreadId()Returns the ID of the thread executing the query.- Returns:
- thread ID
-
getProxyEventType
ProxyEventType getProxyEventType()Returns the proxy event type for the query execution.- Returns:
- proxy event type; one of
ProxyEventType.BEFORE_QUERY,ProxyEventType.AFTER_QUERY, orProxyEventType.EACH_QUERY_RESULT
-
getCurrentResultCount
int getCurrentResultCount()Represents the NthResult. For each query-result callback (ProxyExecutionListener.eachQueryResult(QueryExecutionInfo)), this value indicates the NthResult, starting from 1 (first, second, third, and so on). This returns 0 before query execution (ProxyExecutionListener.beforeQuery(QueryExecutionInfo)). For after-query execution (ProxyExecutionListener.afterQuery(QueryExecutionInfo)), it returns the total number ofResultobjects returned by this query execution.- Returns:
- Nth number of query result
-
getCurrentMappedResult
The mapped query result available for each query-result callback (ProxyExecutionListener.eachQueryResult(QueryExecutionInfo)). For the before- and after-query execution callbacks (ProxyExecutionListener.beforeQuery(QueryExecutionInfo)andProxyExecutionListener.afterQuery(QueryExecutionInfo)), this returnsnull.- Returns:
- currently mapped result
-
getValueStore
ValueStore getValueStore()Returns theValueStoreassociated with the scope of the before/after query execution. Mainly used for passing values betweenProxyExecutionListener.beforeQuery(QueryExecutionInfo)andProxyExecutionListener.afterQuery(QueryExecutionInfo).- Returns:
- value store
-