public abstract class QueryAssembler extends Object
Modifier and Type | Class and Description |
---|---|
protected static interface |
QueryAssembler.AddBindingListener |
Modifier and Type | Field and Description |
---|---|
protected DbAdapter |
adapter |
protected QueryAssembler.AddBindingListener |
addBindingListener |
protected List<DbAttributeBinding> |
bindings |
protected EntityResolver |
entityResolver |
protected Query |
query |
protected QueryMetadata |
queryMetadata |
protected String |
sql |
protected boolean |
translated |
Constructor and Description |
---|
QueryAssembler(Query query,
DbAdapter adapter,
EntityResolver entityResolver) |
Modifier and Type | Method and Description |
---|---|
void |
addToParamList(DbAttribute dbAttr,
Object anObject)
Registers
anObject as a PreparedStatement parameter. |
abstract void |
dbRelationshipAdded(DbRelationship relationship,
JoinType joinType,
String joinSplitAlias)
Appends a join with given semantics to the query.
|
protected abstract void |
doTranslate() |
protected void |
ensureTranslated() |
DbAdapter |
getAdapter() |
abstract String |
getAliasForExpression(Expression exp) |
DbAttributeBinding[] |
getBindings() |
abstract String |
getCurrentAlias()
Returns an alias of the table which is currently at the top of the join
stack.
|
EntityResolver |
getEntityResolver() |
protected Map<String,String> |
getPathAliases()
Returns aliases for the path splits defined in the query.
|
Query |
getQuery()
Returns query object being processed.
|
QueryMetadata |
getQueryMetadata() |
String |
getSql()
Translates query into an SQL string formatted to use in a
PreparedStatement.
|
abstract void |
resetJoinStack()
A callback invoked by a child qualifier or ordering processor allowing
query assembler to reset its join stack.
|
void |
setAddBindingListener(QueryAssembler.AddBindingListener addBindingListener) |
boolean |
supportsTableAliases()
Returns
true if table aliases are supported. |
protected Query query
protected QueryMetadata queryMetadata
protected boolean translated
protected String sql
protected DbAdapter adapter
protected EntityResolver entityResolver
protected List<DbAttributeBinding> bindings
protected QueryAssembler.AddBindingListener addBindingListener
public QueryAssembler(Query query, DbAdapter adapter, EntityResolver entityResolver)
protected Map<String,String> getPathAliases()
public EntityResolver getEntityResolver()
public DbAdapter getAdapter()
public Query getQuery()
public QueryMetadata getQueryMetadata()
public abstract void resetJoinStack()
public abstract String getCurrentAlias()
public abstract void dbRelationshipAdded(DbRelationship relationship, JoinType joinType, String joinSplitAlias)
public String getSql()
protected void ensureTranslated()
protected abstract void doTranslate()
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 DbAttributeBinding[] getBindings()
public abstract String getAliasForExpression(Expression exp)
public void setAddBindingListener(QueryAssembler.AddBindingListener addBindingListener)
Copyright © 2001–2017 Apache Cayenne. All rights reserved.