Class SQLListenerContextImpl

java.lang.Object
com.querydsl.sql.SQLListenerContextImpl
All Implemented Interfaces:
SQLListenerContext

public class SQLListenerContextImpl extends Object implements SQLListenerContext
A mutable implementation of SQL listener context.

INTERNAL USE ONLY - SQLDetailedListener implementations are not expected to use this class directly

  • Constructor Details

  • Method Details

    • addSQL

      public void addSQL(SQLBindings sql)
    • setEntity

      public void setEntity(RelationalPath<?> entity)
    • setConnection

      public void setConnection(Connection connection)
    • setException

      public void setException(Exception exception)
    • addPreparedStatement

      public void addPreparedStatement(PreparedStatement preparedStatement)
    • getMetadata

      public QueryMetadata getMetadata()
      Description copied from interface: SQLListenerContext
      Return the underlying query metadata
      Specified by:
      getMetadata in interface SQLListenerContext
      Returns:
      the underlying query metadata
    • getEntity

      public RelationalPath<?> getEntity()
      Description copied from interface: SQLListenerContext
      Return the underlying entity affected

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

      Specified by:
      getEntity in interface SQLListenerContext
      Returns:
      the underlying entity affected
    • getSQL

      public String getSQL()
      Description copied from interface: SQLListenerContext
      Return the underlying sql or first in a batch query

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

      Specified by:
      getSQL in interface SQLListenerContext
      Returns:
      the underlying sql or first in a batch query
    • getSQLBindings

      public SQLBindings getSQLBindings()
      Description copied from interface: SQLListenerContext
      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

      Specified by:
      getSQLBindings in interface SQLListenerContext
      Returns:
      the underlying sql including bindings or first in a batch query
    • getSQLStatements

      public Collection<String> getSQLStatements()
      Description copied from interface: SQLListenerContext
      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

      Specified by:
      getSQLStatements in interface SQLListenerContext
      Returns:
      the underlying sql collection if the query is a batch query
    • getAllSQLBindings

      public Collection<SQLBindings> getAllSQLBindings()
      Description copied from interface: SQLListenerContext
      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

      Specified by:
      getAllSQLBindings in interface SQLListenerContext
      Returns:
      the underlying sql collection including bindings if the query is a batch query
    • getException

      public Exception getException()
      Description copied from interface: SQLListenerContext
      Return the underlying exception that has happened during query execution

      NOTE : This can be null depending on whether an exception occurred

      Specified by:
      getException in interface SQLListenerContext
      Returns:
      the underlying exception that has happened during query execution
    • getConnection

      public Connection getConnection()
      Description copied from interface: SQLListenerContext
      Return the underlying connection if there is one

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

      Specified by:
      getConnection in interface SQLListenerContext
      Returns:
      the underlying connection if there is one
    • getPreparedStatements

      public Collection<PreparedStatement> getPreparedStatements()
      Description copied from interface: SQLListenerContext
      Return the underlying set of prepared statements

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

      Specified by:
      getPreparedStatements in interface SQLListenerContext
      Returns:
      the underlying set of prepared statements
    • getPreparedStatement

      public PreparedStatement getPreparedStatement()
      Description copied from interface: SQLListenerContext
      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

      Specified by:
      getPreparedStatement in interface SQLListenerContext
      Returns:
      the underlying prepared statement or the first if its batch query
    • getData

      public Object getData(String dataKey)
      Description copied from interface: SQLListenerContext
      The context getData is a general purpose place that listeners can place objects. It allows listeners to pass context between themselves during callbacks.

      Specified by:
      getData in interface SQLListenerContext
      Parameters:
      dataKey - the key to look up
      Returns:
      the context object under that key
    • setData

      public void setData(String dataKey, Object value)
      Description copied from interface: SQLListenerContext
      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.

      Specified by:
      setData in interface SQLListenerContext
      Parameters:
      dataKey - the key to use
      value - the value to place under that key
    • toString

      public String toString()
      Overrides:
      toString in class Object