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()
SQLListenerContextgetMetadata in interface SQLListenerContextpublic RelationalPath<?> getEntity()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getEntity in interface SQLListenerContextpublic String getSQL()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getSQL in interface SQLListenerContextpublic Collection<String> getSQLStatements()
SQLListenerContextNOTE : This can be empty depending on the stage of the query execution
getSQLStatements in interface SQLListenerContextpublic Exception getException()
SQLListenerContextNOTE : This can be null depending on whether an exception occurred
getException in interface SQLListenerContextpublic Connection getConnection()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getConnection in interface SQLListenerContextpublic Collection<PreparedStatement> getPreparedStatements()
SQLListenerContextNOTE : This can be empty depending on the stage of the query execution
getPreparedStatements in interface SQLListenerContextpublic PreparedStatement getPreparedStatement()
SQLListenerContextNOTE : This can be null depending on the stage of the query execution
getPreparedStatement in interface SQLListenerContextpublic Object getData(String dataKey)
SQLListenerContextgetData in interface SQLListenerContextdataKey - 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 SQLListenerContextdataKey - the key to usevalue - the value to place under that keyCopyright © 2007–2015 Mysema Ltd. All rights reserved.