Class FromClause

All Implemented Interfaces:
antlr.collections.AST, Serializable, HqlSqlTokenTypes, DisplayableNode, InitializeableNode

public class FromClause extends HqlSqlWalkerNode implements HqlSqlTokenTypes, DisplayableNode
Represents the 'FROM' part of a query or subquery, containing all mapped class references.
See Also:
  • Field Details

  • Constructor Details

    • FromClause

      public FromClause()
  • Method Details

    • addFromElement

      public FromElement addFromElement(String path, antlr.collections.AST alias) throws antlr.SemanticException
      Adds a new from element to the from node.
      Parameters:
      path - The reference to the class.
      alias - The alias AST.
      Returns:
      FromElement - The new FROM element.
      Throws:
      antlr.SemanticException
    • getFromElement

      public FromElement getFromElement(String aliasOrClassName)
      Retreives the from-element represented by the given alias.
      Parameters:
      aliasOrClassName - The alias by which to locate the from-element.
      Returns:
      The from-element assigned the given alias, or null if none.
    • findFromElementBySqlAlias

      public FromElement findFromElementBySqlAlias(String sqlAlias)
    • findFromElementByUserOrSqlAlias

      public FromElement findFromElementByUserOrSqlAlias(String userAlias, String sqlAlias)
    • isFromElementAlias

      public boolean isFromElementAlias(String possibleAlias)
      Convenience method to check whether a given token represents a from-element alias.
      Parameters:
      possibleAlias - The potential from-element alias to check.
      Returns:
      True if the possibleAlias is an alias to a from-element visible from this point in the query graph.
    • getFromElements

      public List getFromElements()
      Returns the list of from elements in order.
      Returns:
      the list of from elements (instances of FromElement).
    • getFromElement

      public FromElement getFromElement()
    • getProjectionList

      public List getProjectionList()
      Returns the list of from elements that will be part of the result set.
      Returns:
      the list of from elements that will be part of the result set.
    • getCollectionFetches

      public List getCollectionFetches()
    • hasCollectionFecthes

      public boolean hasCollectionFecthes()
    • getExplicitFromElements

      public List getExplicitFromElements()
    • containsClassAlias

      public boolean containsClassAlias(String alias)
      Returns true if the from node contains the class alias name.
      Parameters:
      alias - The HQL class alias name.
      Returns:
      true if the from node contains the class alias name.
    • containsTableAlias

      public boolean containsTableAlias(String alias)
      Returns true if the from node contains the table alias name.
      Parameters:
      alias - The SQL table alias name.
      Returns:
      true if the from node contains the table alias name.
    • getDisplayText

      public String getDisplayText()
      Description copied from interface: DisplayableNode
      Returns additional display text for the AST node.
      Specified by:
      getDisplayText in interface DisplayableNode
      Returns:
      String - The additional display text.
    • setParentFromClause

      public void setParentFromClause(FromClause parentFromClause)
    • locateChildFromClauseWithJoinByPath

      public FromClause locateChildFromClauseWithJoinByPath(String path)
    • promoteJoin

      public void promoteJoin(FromElement elem)
    • isSubQuery

      public boolean isSubQuery()
    • getParentFromClause

      public FromClause getParentFromClause()
    • getLevel

      public int getLevel()
    • nextFromElementCounter

      public int nextFromElementCounter()
    • resolve

      public void resolve()
    • addImpliedFromElement

      public void addImpliedFromElement(FromElement element)
    • toString

      public String toString()
      Specified by:
      toString in interface antlr.collections.AST
      Overrides:
      toString in class antlr.BaseAST