public class SQLListenerContextImpl extends java.lang.Object implements SQLListenerContext
INTERNAL USE ONLY - SQLDetailedListener
implementations are not expected to use this
class directly
Constructor and Description |
---|
SQLListenerContextImpl(QueryMetadata metadata) |
SQLListenerContextImpl(QueryMetadata metadata,
java.sql.Connection connection) |
SQLListenerContextImpl(QueryMetadata metadata,
java.sql.Connection connection,
RelationalPath<?> entity) |
Modifier and Type | Method and Description |
---|---|
void |
addPreparedStatement(java.sql.PreparedStatement preparedStatement) |
void |
addSQL(SQLBindings sql) |
java.util.Collection<SQLBindings> |
getAllSQLBindings()
Return the underlying sql collection including bindings if the query is a batch query
|
java.sql.Connection |
getConnection()
Return the underlying connection if there is one
|
java.lang.Object |
getData(java.lang.String dataKey)
The context getData is a general purpose place that listeners can place objects.
|
RelationalPath<?> |
getEntity()
Return the underlying entity affected
|
java.lang.Exception |
getException()
Return the underlying exception that has happened during query execution
|
QueryMetadata |
getMetadata()
Return the underlying query metadata
|
java.sql.PreparedStatement |
getPreparedStatement()
Return the underlying prepared statement or the first if its batch query
|
java.util.Collection<java.sql.PreparedStatement> |
getPreparedStatements()
Return the underlying set of prepared statements
|
java.lang.String |
getSQL()
Return the underlying sql or first in a batch query
|
SQLBindings |
getSQLBindings()
Return the underlying sql including bindings or first in a batch query
|
java.util.Collection<java.lang.String> |
getSQLStatements()
Return the underlying sql collection if the query is a batch query
|
void |
setConnection(java.sql.Connection connection) |
void |
setData(java.lang.String dataKey,
java.lang.Object value)
The context setData is a general purpose place that listeners can place objects.
|
void |
setEntity(RelationalPath<?> entity) |
void |
setException(java.lang.Exception exception) |
java.lang.String |
toString() |
public SQLListenerContextImpl(QueryMetadata metadata, java.sql.Connection connection, RelationalPath<?> entity)
public SQLListenerContextImpl(QueryMetadata metadata, java.sql.Connection connection)
public SQLListenerContextImpl(QueryMetadata metadata)
public void addSQL(SQLBindings sql)
public void setEntity(RelationalPath<?> entity)
public void setConnection(java.sql.Connection connection)
public void setException(java.lang.Exception exception)
public void addPreparedStatement(java.sql.PreparedStatement preparedStatement)
public QueryMetadata getMetadata()
SQLListenerContext
getMetadata
in interface SQLListenerContext
public RelationalPath<?> getEntity()
SQLListenerContext
NOTE : This can be null depending on the stage of the query execution
getEntity
in interface SQLListenerContext
public java.lang.String getSQL()
SQLListenerContext
NOTE : This can be null depending on the stage of the query execution
getSQL
in interface SQLListenerContext
public SQLBindings getSQLBindings()
SQLListenerContext
NOTE : This can be null depending on the stage of the query execution
getSQLBindings
in interface SQLListenerContext
public java.util.Collection<java.lang.String> getSQLStatements()
SQLListenerContext
NOTE : This can be empty depending on the stage of the query execution
getSQLStatements
in interface SQLListenerContext
public java.util.Collection<SQLBindings> getAllSQLBindings()
SQLListenerContext
NOTE : This can be empty depending on the stage of the query execution
getAllSQLBindings
in interface SQLListenerContext
public java.lang.Exception getException()
SQLListenerContext
NOTE : This can be null depending on whether an exception occurred
getException
in interface SQLListenerContext
public java.sql.Connection getConnection()
SQLListenerContext
NOTE : This can be null depending on the stage of the query execution
getConnection
in interface SQLListenerContext
public java.util.Collection<java.sql.PreparedStatement> getPreparedStatements()
SQLListenerContext
NOTE : This can be empty depending on the stage of the query execution
getPreparedStatements
in interface SQLListenerContext
public java.sql.PreparedStatement getPreparedStatement()
SQLListenerContext
NOTE : This can be null depending on the stage of the query execution
getPreparedStatement
in interface SQLListenerContext
public java.lang.Object getData(java.lang.String dataKey)
SQLListenerContext
getData
in interface SQLListenerContext
dataKey
- the key to look uppublic void setData(java.lang.String dataKey, java.lang.Object value)
SQLListenerContext
A good time to place objects into the context is during SQLDetailedListener.start(SQLListenerContext)
and then access if after that.
setData
in interface SQLListenerContext
dataKey
- the key to usevalue
- the value to place under that keypublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007–2021 Querydsl. All rights reserved.