public class SQLListenerContextImpl extends 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,
Connection connection) |
SQLListenerContextImpl(QueryMetadata metadata,
Connection connection,
RelationalPath<?> entity) |
Modifier and Type | Method and Description |
---|---|
void |
addPreparedStatement(PreparedStatement preparedStatement) |
void |
addSQL(String sql) |
Connection |
getConnection()
Return the underlying connection if there is one
|
Object |
getData(String dataKey)
The context getData is a general purpose place that listeners can place objects.
|
RelationalPath<?> |
getEntity()
Return the underlying entity affected
|
Exception |
getException()
Return the underlying exception that has happened during query execution
|
QueryMetadata |
getMetadata()
Return the underlying query metadata
|
PreparedStatement |
getPreparedStatement()
Return the underlying prepared statement or the first if its batch query
|
Collection<PreparedStatement> |
getPreparedStatements()
Return the underlying set of prepared statements
|
String |
getSQL()
Return the underlying sql or first in a batch query
|
Collection<String> |
getSQLStatements()
Return the underlying sql collection if the query is a batch query
|
void |
setConnection(Connection connection) |
void |
setData(String dataKey,
Object value)
The context setData is a general purpose place that listeners can place objects.
|
void |
setEntity(RelationalPath<?> entity) |
void |
setException(Exception exception) |
String |
toString() |
public SQLListenerContextImpl(QueryMetadata metadata, Connection connection, RelationalPath<?> entity)
public SQLListenerContextImpl(QueryMetadata metadata, Connection connection)
public SQLListenerContextImpl(QueryMetadata metadata)
public void addSQL(String sql)
public void setEntity(RelationalPath<?> entity)
public void setConnection(Connection connection)
public void setException(Exception exception)
public void addPreparedStatement(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 String getSQL()
SQLListenerContext
NOTE : This can be null depending on the stage of the query execution
getSQL
in interface SQLListenerContext
public Collection<String> getSQLStatements()
SQLListenerContext
NOTE : This can be empty depending on the stage of the query execution
getSQLStatements
in interface SQLListenerContext
public Exception getException()
SQLListenerContext
NOTE : This can be null depending on whether an exception occurred
getException
in interface SQLListenerContext
public Connection getConnection()
SQLListenerContext
NOTE : This can be null depending on the stage of the query execution
getConnection
in interface SQLListenerContext
public Collection<PreparedStatement> getPreparedStatements()
SQLListenerContext
NOTE : This can be empty depending on the stage of the query execution
getPreparedStatements
in interface SQLListenerContext
public PreparedStatement getPreparedStatement()
SQLListenerContext
NOTE : This can be null depending on the stage of the query execution
getPreparedStatement
in interface SQLListenerContext
public Object getData(String dataKey)
SQLListenerContext
getData
in interface SQLListenerContext
dataKey
- the key to look uppublic void setData(String dataKey, 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 keyCopyright © 2007–2016 Querydsl. All rights reserved.