Interface SQLListenerContext
- All Known Implementing Classes:
SQLListenerContextImpl
SQLDetailedListener callback method-
Method Summary
Modifier and TypeMethodDescriptionReturn the underlying sql collection including bindings if the query is a batch queryReturn the underlying connection if there is oneThe context getData is a general purpose place that listeners can place objects.Return the underlying entity affectedReturn the underlying exception that has happened during query executionReturn the underlying query metadataReturn the underlying prepared statement or the first if its batch queryReturn the underlying set of prepared statementsgetSQL()Return the underlying sql or first in a batch queryReturn the underlying sql including bindings or first in a batch queryReturn the underlying sql collection if the query is a batch queryvoidThe context setData is a general purpose place that listeners can place objects.
-
Method Details
-
getData
The context getData is a general purpose place that listeners can place objects. It allows listeners to pass context between themselves during callbacks.- Parameters:
dataKey- the key to look up- Returns:
- the context object under that key
-
setData
The context setData is a general purpose place that listeners can place objects. It allows listeners to pass context between themselves during callbacks.A good time to place objects into the context is during
SQLDetailedListener.start(SQLListenerContext)and then access if after that.- Parameters:
dataKey- the key to usevalue- the value to place under that key
-
getMetadata
QueryMetadata getMetadata()Return the underlying query metadata- Returns:
- the underlying query metadata
-
getSQL
String getSQL()Return the underlying sql or first in a batch queryNOTE : This can be null depending on the stage of the query execution
- Returns:
- the underlying sql or first in a batch query
-
getSQLBindings
SQLBindings getSQLBindings()Return the underlying sql including bindings or first in a batch queryNOTE : This can be null depending on the stage of the query execution
- Returns:
- the underlying sql including bindings or first in a batch query
-
getSQLStatements
Collection<String> getSQLStatements()Return the underlying sql collection if the query is a batch queryNOTE : This can be empty depending on the stage of the query execution
- Returns:
- the underlying sql collection if the query is a batch query
-
getAllSQLBindings
Collection<SQLBindings> getAllSQLBindings()Return the underlying sql collection including bindings if the query is a batch queryNOTE : This can be empty depending on the stage of the query execution
- Returns:
- the underlying sql collection including bindings if the query is a batch query
-
getEntity
RelationalPath<?> getEntity()Return the underlying entity affectedNOTE : This can be null depending on the stage of the query execution
- Returns:
- the underlying entity affected
-
getConnection
Connection getConnection()Return the underlying connection if there is oneNOTE : This can be null depending on the stage of the query execution
- Returns:
- the underlying connection if there is one
-
getException
Exception getException()Return the underlying exception that has happened during query executionNOTE : This can be null depending on whether an exception occurred
- Returns:
- the underlying exception that has happened during query execution
-
getPreparedStatement
PreparedStatement getPreparedStatement()Return the underlying prepared statement or the first if its batch queryNOTE : This can be null depending on the stage of the query execution
- Returns:
- the underlying prepared statement or the first if its batch query
-
getPreparedStatements
Collection<PreparedStatement> getPreparedStatements()Return the underlying set of prepared statementsNOTE : This can be empty depending on the stage of the query execution
- Returns:
- the underlying set of prepared statements
-