Class QueryAssembler
java.lang.Object
org.apache.cayenne.access.translator.select.QueryAssembler
- Direct Known Subclasses:
- DefaultSelectTranslator
public abstract class QueryAssembler extends Object
Abstract superclass of Query translators.
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static interfaceQueryAssembler.AddBindingListener
- 
Field SummaryFields Modifier and Type Field Description protected DbAdapteradapterprotected QueryAssembler.AddBindingListeneraddBindingListenerprotected List<DbAttributeBinding>bindingsprotected EntityResolverentityResolverprotected Queryqueryprotected QueryMetadataqueryMetadataprotected Stringsqlprotected booleantranslated
- 
Constructor SummaryConstructors Constructor Description QueryAssembler(Query query, DbAdapter adapter, EntityResolver entityResolver)
- 
Method SummaryModifier and Type Method Description voidaddToParamList(DbAttribute dbAttr, Object anObject)RegistersanObjectas a PreparedStatement parameter.abstract voiddbRelationshipAdded(DbRelationship relationship, JoinType joinType, String joinSplitAlias)Appends a join with given semantics to the query.protected abstract voiddoTranslate()protected voidensureTranslated()DbAdaptergetAdapter()abstract StringgetAliasForExpression(Expression exp)DbAttributeBinding[]getBindings()abstract StringgetCurrentAlias()Returns an alias of the table which is currently at the top of the join stack.EntityResolvergetEntityResolver()protected Map<String,String>getPathAliases()Returns aliases for the path splits defined in the query.QuerygetQuery()Returns query object being processed.QueryMetadatagetQueryMetadata()StringgetSql()Translates query into an SQL string formatted to use in a PreparedStatement.abstract voidresetJoinStack()A callback invoked by a child qualifier or ordering processor allowing query assembler to reset its join stack.voidsetAddBindingListener(QueryAssembler.AddBindingListener addBindingListener)booleansupportsTableAliases()Returnstrueif table aliases are supported.
- 
Field Details- 
query
- 
queryMetadata
- 
translatedprotected boolean translated
- 
sql
- 
adapter
- 
entityResolver
- 
bindings
- 
addBindingListener- Since:
- 4.0
 
 
- 
- 
Constructor Details- 
QueryAssembler- Since:
- 4.0
 
 
- 
- 
Method Details- 
getPathAliasesReturns aliases for the path splits defined in the query.- Since:
- 3.0
 
- 
getEntityResolver
- 
getAdapter
- 
getQueryReturns query object being processed.
- 
getQueryMetadata
- 
resetJoinStackpublic abstract void resetJoinStack()A callback invoked by a child qualifier or ordering processor allowing query assembler to reset its join stack.- Since:
- 3.0
 
- 
getCurrentAliasReturns an alias of the table which is currently at the top of the join stack.- Since:
- 3.0
 
- 
dbRelationshipAddedpublic abstract void dbRelationshipAdded(DbRelationship relationship, JoinType joinType, String joinSplitAlias)Appends a join with given semantics to the query.- Since:
- 3.0
 
- 
getSqlTranslates query into an SQL string formatted to use in a PreparedStatement.
- 
ensureTranslatedprotected void ensureTranslated()- Since:
- 4.0
 
- 
doTranslateprotected abstract void doTranslate()- Since:
- 4.0
 
- 
supportsTableAliasespublic boolean supportsTableAliases()Returnstrueif table aliases are supported. Default implementation returns false.
- 
addToParamListRegistersanObjectas a PreparedStatement parameter.- Parameters:
- anObject- object that represents a value of DbAttribute
- dbAttr- DbAttribute being processed.
 
- 
getBindings- Since:
- 4.0
 
- 
getAliasForExpression- Since:
- 4.0
 
- 
setAddBindingListener- Since:
- 4.0
 
 
-