public abstract class QueryAssembler extends Object
Modifier and Type | Field and Description |
---|---|
protected DbAdapter |
adapter |
protected List<DbAttribute> |
attributes
PreparedStatement attributes matching entries in
values
list. |
protected String |
cachedSqlString |
protected Connection |
connection |
protected EntityResolver |
entityResolver |
protected JdbcEventLogger |
logger |
protected int |
parameterIndex
The index parameter will be inserted at in parameter list
|
protected Query |
query |
protected QueryMetadata |
queryMetadata |
protected List<Object> |
values
Holds PreparedStatement values.
|
Constructor and Description |
---|
QueryAssembler(Query query,
DataNode dataNode,
Connection connection) |
Modifier and Type | Method and Description |
---|---|
void |
addToParamList(DbAttribute dbAttr,
Object anObject)
Registers
anObject as a PreparedStatement parameter. |
abstract String |
createSqlString()
Translates query into sql string.
|
PreparedStatement |
createStatement()
Translates internal query into PreparedStatement.
|
abstract void |
dbRelationshipAdded(DbRelationship relationship,
JoinType joinType,
String joinSplitAlias)
Appends a join with given semantics to the query.
|
DbAdapter |
getAdapter() |
abstract String |
getCurrentAlias()
Returns an alias of the table which is currently at the top of the join
stack.
|
EntityResolver |
getEntityResolver() |
JdbcEventLogger |
getJdbcEventLogger() |
protected Map<String,String> |
getPathAliases()
Returns aliases for the path splits defined in the query.
|
Query |
getQuery()
Returns query object being processed.
|
QueryMetadata |
getQueryMetadata() |
DbEntity |
getRootDbEntity() |
ObjEntity |
getRootEntity() |
protected void |
initStatement(PreparedStatement stmt)
Initializes prepared statements with collected parameters.
|
abstract void |
resetJoinStack()
A callback invoked by a child qualifier or ordering processor allowing
query assembler to reset its join stack.
|
boolean |
supportsTableAliases()
Returns
true if table aliases are supported. |
protected Query query
protected QueryMetadata queryMetadata
protected String cachedSqlString
protected Connection connection
protected DbAdapter adapter
protected EntityResolver entityResolver
protected JdbcEventLogger logger
protected List<DbAttribute> attributes
values
list.protected int parameterIndex
public QueryAssembler(Query query, DataNode dataNode, Connection connection)
protected Map<String,String> getPathAliases()
public EntityResolver getEntityResolver()
public DbAdapter getAdapter()
public Query getQuery()
public QueryMetadata getQueryMetadata()
public JdbcEventLogger getJdbcEventLogger()
public DbEntity getRootDbEntity()
public ObjEntity getRootEntity()
public abstract void resetJoinStack()
public abstract String getCurrentAlias()
public abstract void dbRelationshipAdded(DbRelationship relationship, JoinType joinType, String joinSplitAlias)
public abstract String createSqlString() throws Exception
createStatement
. Usually there is no need to invoke it explicitly.Exception
public boolean supportsTableAliases()
true
if table aliases are supported. Default
implementation returns false.public void addToParamList(DbAttribute dbAttr, Object anObject)
anObject
as a PreparedStatement parameter.anObject
- object that represents a value of DbAttributedbAttr
- DbAttribute being processed.public PreparedStatement createStatement() throws Exception
Exception
protected void initStatement(PreparedStatement stmt) throws Exception
Exception
Copyright © 2001–2015 Apache Cayenne. All rights reserved.