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.
  • Field Details

  • Constructor Details

  • Method Details

    • getPathAliases

      protected Map<String,​String> getPathAliases()
      Returns aliases for the path splits defined in the query.
      Since:
      3.0
    • getEntityResolver

      public EntityResolver getEntityResolver()
    • getAdapter

      public DbAdapter getAdapter()
    • getQuery

      public Query getQuery()
      Returns query object being processed.
    • getQueryMetadata

      public QueryMetadata getQueryMetadata()
    • resetJoinStack

      public abstract void resetJoinStack()
      A callback invoked by a child qualifier or ordering processor allowing query assembler to reset its join stack.
      Since:
      3.0
    • getCurrentAlias

      public abstract String getCurrentAlias()
      Returns an alias of the table which is currently at the top of the join stack.
      Since:
      3.0
    • dbRelationshipAdded

      public abstract void dbRelationshipAdded​(DbRelationship relationship, JoinType joinType, String joinSplitAlias)
      Appends a join with given semantics to the query.
      Since:
      3.0
    • getSql

      public String getSql()
      Translates query into an SQL string formatted to use in a PreparedStatement.
    • ensureTranslated

      protected void ensureTranslated()
      Since:
      4.0
    • doTranslate

      protected abstract void doTranslate()
      Since:
      4.0
    • supportsTableAliases

      public boolean supportsTableAliases()
      Returns true if table aliases are supported. Default implementation returns false.
    • addToParamList

      public void addToParamList​(DbAttribute dbAttr, Object anObject)
      Registers anObject as a PreparedStatement parameter.
      Parameters:
      anObject - object that represents a value of DbAttribute
      dbAttr - DbAttribute being processed.
    • getBindings

      public DbAttributeBinding[] getBindings()
      Since:
      4.0
    • getAliasForExpression

      public abstract String getAliasForExpression​(Expression exp)
      Since:
      4.0
    • setAddBindingListener

      public void setAddBindingListener​(QueryAssembler.AddBindingListener addBindingListener)
      Since:
      4.0