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()
SQLListenerContextgetMetadata in interface SQLListenerContextpublic RelationalPath<?> getEntity()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getEntity in interface SQLListenerContextpublic java.lang.String getSQL()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getSQL in interface SQLListenerContextpublic SQLBindings getSQLBindings()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getSQLBindings in interface SQLListenerContextpublic java.util.Collection<java.lang.String> getSQLStatements()
SQLListenerContextNOTE : This can be empty depending on the stage of the query execution
getSQLStatements in interface SQLListenerContextpublic java.util.Collection<SQLBindings> getAllSQLBindings()
SQLListenerContextNOTE : This can be empty depending on the stage of the query execution
getAllSQLBindings in interface SQLListenerContextpublic java.lang.Exception getException()
SQLListenerContextNOTE : This can be null depending on whether an exception occurred
getException in interface SQLListenerContextpublic java.sql.Connection getConnection()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getConnection in interface SQLListenerContextpublic java.util.Collection<java.sql.PreparedStatement> getPreparedStatements()
SQLListenerContextNOTE : This can be empty depending on the stage of the query execution
getPreparedStatements in interface SQLListenerContextpublic java.sql.PreparedStatement getPreparedStatement()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getPreparedStatement in interface SQLListenerContextpublic java.lang.Object getData(java.lang.String dataKey)
SQLListenerContextgetData in interface SQLListenerContextdataKey - 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 SQLListenerContextdataKey - the key to usevalue - the value to place under that keypublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2007–2021 Querydsl. All rights reserved.