Interface QueryExecutionInfo
- All Known Implementing Classes:
MockQueryExecutionInfo
public interface QueryExecutionInfo
Hold query execution related information.
- Author:
- Tadaya Tsuyukubo
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the size of the batch query.int
Get the number of the binding.Get the associatedConnectionInfo
.Mapped query result available for each-query-result-callback(ProxyExecutionListener.eachQueryResult(QueryExecutionInfo)
).int
Represent NthResult
.Get the time that took queries to execute.Get the invoked query executionMethod
.Object[]
Get the arguments of the invocation.Get the proxy event type for query execution.Get the list ofQueryInfo
.long
Get the currently executed thread ID.Get the currently executed thread name.Get the thrown exception.getType()
Get the type of query execution.RetrieveValueStore
which is associated to the scope of before/after method execution.boolean
Indicate whether the query execution was successful or not.
-
Method Details
-
getMethod
-
getMethodArgs
-
getThrowable
Get the thrown exception. ForProxyExecutionListener.beforeQuery(QueryExecutionInfo)
callback or query execution did't throw any error, this returnsnull
.- Returns:
- thrown exception
-
getConnectionInfo
-
isSuccess
boolean isSuccess()Indicate whether the query execution was successful or not. Contains valid value only after the query execution. Query execution is considered successful when thePublisher
returned 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()Get the size of the batch query. i.e. Number of the calls ofBatch.add(String)
.- Returns:
- batch size
-
getQueries
-
getType
-
getBindingsSize
int getBindingsSize()Get the number of the binding. i.e. Number of the calls ofStatement.add()
.- Returns:
- size of the binding
-
getExecuteDuration
Duration getExecuteDuration()Get the time that took queries to execute.Duration is only populated in appropriate phase. (e.g.:
ProxyExecutionListener.afterQuery(QueryExecutionInfo)
)- Returns:
- query execution duration
-
getThreadName
-
getThreadId
long getThreadId()Get the currently executed thread ID.- Returns:
- thread ID
-
getProxyEventType
ProxyEventType getProxyEventType()Get the proxy event type for query execution.- Returns:
- proxy event type; one of
ProxyEventType.BEFORE_QUERY
,ProxyEventType.AFTER_QUERY
, orProxyEventType.EACH_QUERY_RESULT
-
getCurrentResultCount
int getCurrentResultCount()Represent NthResult
. On each query result callback(ProxyExecutionListener.eachQueryResult(QueryExecutionInfo)
), this value indicates NthResult
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 ofResult
returned by this query execution.- Returns:
- Nth number of query result
-
getCurrentMappedResult
Mapped query result available for each-query-result-callback(ProxyExecutionListener.eachQueryResult(QueryExecutionInfo)
). For before and after query execution(ProxyExecutionListener.beforeQuery(QueryExecutionInfo)
andProxyExecutionListener.afterQuery(QueryExecutionInfo)
), this returnsnull
.- Returns:
- currently mapped result
-
getValueStore
ValueStore getValueStore()RetrieveValueStore
which is associated to the scope of before/after method execution. Mainly used for passing values betweenProxyExecutionListener.beforeQuery(QueryExecutionInfo)
andProxyExecutionListener.afterQuery(QueryExecutionInfo)
.- Returns:
- value store
-