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()
NOTE : This can be null depending on the stage of the query execution
|
Object |
getData(String dataKey)
The context getData is a general purpose place that listeners can place objects.
|
RelationalPath<?> |
getEntity()
NOTE : This can be null depending on the stage of the query execution
|
Exception |
getException()
NOTE : This can be null depending on whether an exception occurred
|
QueryMetadata |
getMetadata() |
PreparedStatement |
getPreparedStatement()
NOTE : This can be null depending on the stage of the query execution
|
Collection<PreparedStatement> |
getPreparedStatements()
NOTE : This can be empty depending on the stage of the query execution
|
String |
getSQL()
NOTE : This can be null depending on the stage of the query execution
|
Collection<String> |
getSQLStatements()
NOTE : This can be empty depending on the stage of the query execution
|
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()
getMetadata
in interface SQLListenerContext
public RelationalPath<?> getEntity()
SQLListenerContext
getEntity
in interface SQLListenerContext
public String getSQL()
SQLListenerContext
getSQL
in interface SQLListenerContext
public Collection<String> getSQLStatements()
SQLListenerContext
getSQLStatements
in interface SQLListenerContext
public Exception getException()
SQLListenerContext
getException
in interface SQLListenerContext
public Connection getConnection()
SQLListenerContext
getConnection
in interface SQLListenerContext
public Collection<PreparedStatement> getPreparedStatements()
SQLListenerContext
getPreparedStatements
in interface SQLListenerContext
public PreparedStatement getPreparedStatement()
SQLListenerContext
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–2015 Mysema Ltd. All rights reserved.