public class DefaultSelectTranslator extends QueryAssembler implements SelectTranslator
QueryAssembler.AddBindingListener| Modifier and Type | Field and Description |
|---|---|
protected static int[] |
UNSUPPORTED_DISTINCT_TYPES |
adapter, addBindingListener, bindings, entityResolver, query, queryMetadata, sql, translated| Constructor and Description |
|---|
DefaultSelectTranslator(Query query,
DbAdapter adapter,
EntityResolver entityResolver) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendGroupByColumn(StringBuilder buffer,
Map.Entry<ColumnDescriptor,List<DbAttributeBinding>> entry)
Append single column to GROUP BY clause
|
protected void |
appendGroupByColumns(StringBuilder buffer,
Map<ColumnDescriptor,List<DbAttributeBinding>> groupByColumns)
Append columns to GROUP BY clause
|
protected void |
appendLimitAndOffsetClauses(StringBuilder buffer)
Handles appending optional limit and offset clauses.
|
protected void |
appendSelectColumns(StringBuilder buffer,
List<String> selectColumnExpList) |
protected String |
buildDistinctStatement()
Allows subclasses to insert their own dialect of DISTINCT statement to
improve performance.
|
protected List<ColumnDescriptor> |
buildResultColumns() |
protected JoinStack |
createJoinStack() |
void |
dbRelationshipAdded(DbRelationship relationship,
JoinType joinType,
String joinSplitAlias)
Appends a join with given semantics to the query.
|
protected void |
doTranslate() |
String |
getAliasForExpression(Expression exp) |
Map<ObjAttribute,ColumnDescriptor> |
getAttributeOverrides()
Returns a map of ColumnDescriptors keyed by ObjAttribute for columns that
may need to be reprocessed manually due to incompatible mappings along
the inheritance hierarchy.
|
String |
getCurrentAlias()
Returns an alias of the table which is currently at the top of the join
stack.
|
protected JoinStack |
getJoinStack() |
ColumnDescriptor[] |
getResultColumns()
Returns a list of ColumnDescriptors for the query columns.
|
boolean |
hasJoins() |
boolean |
isSuppressingDistinct()
Returns true if SelectTranslator determined that a query requiring
DISTINCT can't be run with DISTINCT keyword for internal reasons.
|
protected static boolean |
isUnsupportedForDistinct(int type) |
void |
resetJoinStack()
A callback invoked by a child qualifier or ordering processor allowing
query assembler to reset its join stack.
|
boolean |
supportsTableAliases()
Always returns true.
|
addToParamList, ensureTranslated, getAdapter, getBindings, getEntityResolver, getPathAliases, getQuery, getQueryMetadata, getSql, setAddBindingListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBindings, getSqlpublic DefaultSelectTranslator(Query query, DbAdapter adapter, EntityResolver entityResolver)
protected static boolean isUnsupportedForDistinct(int type)
protected JoinStack getJoinStack()
protected JoinStack createJoinStack()
protected void doTranslate()
doTranslate in class QueryAssemblerprotected String buildDistinctStatement()
protected void appendSelectColumns(StringBuilder buffer, List<String> selectColumnExpList)
protected void appendGroupByColumns(StringBuilder buffer, Map<ColumnDescriptor,List<DbAttributeBinding>> groupByColumns)
protected void appendGroupByColumn(StringBuilder buffer, Map.Entry<ColumnDescriptor,List<DbAttributeBinding>> entry)
protected void appendLimitAndOffsetClauses(StringBuilder buffer)
public String getCurrentAlias()
QueryAssemblergetCurrentAlias in class QueryAssemblerpublic ColumnDescriptor[] getResultColumns()
getResultColumns in interface SelectTranslatorpublic Map<ObjAttribute,ColumnDescriptor> getAttributeOverrides()
getAttributeOverrides in interface SelectTranslatorpublic boolean isSuppressingDistinct()
isSuppressingDistinct in interface SelectTranslatorprotected List<ColumnDescriptor> buildResultColumns()
public void resetJoinStack()
QueryAssemblerresetJoinStack in class QueryAssemblerpublic void dbRelationshipAdded(DbRelationship relationship, JoinType joinType, String joinSplitAlias)
QueryAssemblerdbRelationshipAdded in class QueryAssemblerpublic boolean supportsTableAliases()
supportsTableAliases in class QueryAssemblerpublic String getAliasForExpression(Expression exp)
getAliasForExpression in class QueryAssemblerpublic boolean hasJoins()
hasJoins in interface SelectTranslatorCopyright © 2001–2023 Apache Cayenne. All rights reserved.