Interface SQLListenerContext

All Known Implementing Classes:
SQLListenerContextImpl

public interface SQLListenerContext
A context object that is progressively filled out during query execution and is passed to each SQLDetailedListener callback method
  • Method Details

    • getData

      Object getData(String dataKey)
      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

      void setData(String dataKey, Object value)
      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 use
      value - 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 query

      NOTE : 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 query

      NOTE : 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 query

      NOTE : 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 query

      NOTE : 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 affected

      NOTE : 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 one

      NOTE : 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 execution

      NOTE : 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 query

      NOTE : 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 statements

      NOTE : This can be empty depending on the stage of the query execution

      Returns:
      the underlying set of prepared statements