Package org.hibernate.hql.ast.tree
Class FromClause
java.lang.Object
antlr.BaseAST
antlr.CommonAST
org.hibernate.hql.ast.tree.Node
org.hibernate.hql.ast.tree.SqlNode
org.hibernate.hql.ast.tree.HqlSqlWalkerNode
org.hibernate.hql.ast.tree.FromClause
- All Implemented Interfaces:
antlr.collections.AST,Serializable,HqlSqlTokenTypes,DisplayableNode,InitializeableNode
Represents the 'FROM' part of a query or subquery, containing all mapped class references.
- See Also:
-
Field Summary
FieldsFields inherited from class antlr.BaseAST
down, rightFields inherited from interface org.hibernate.hql.antlr.HqlSqlTokenTypes
AGGREGATE, ALIAS, ALIAS_REF, ALL, AND, ANY, AS, ASCENDING, AVG, BETWEEN, BOGUS, BOTH, CASE, CASE2, CLASS, CLOSE, CLOSE_BRACKET, COLON, COMMA, CONCAT, CONSTANT, CONSTRUCTOR, COUNT, DELETE, DESCENDING, DISTINCT, DIV, DOT, ELEMENTS, ELSE, EMPTY, END, ENTRY, EOF, EQ, ESCAPE, ESCqs, EXISTS, EXPONENT, EXPR_LIST, FALSE, FETCH, FILTER_ENTITY, FILTERS, FLOAT_SUFFIX, FROM, FROM_FRAGMENT, FULL, GE, GROUP, GT, HAVING, HEX_DIGIT, ID_LETTER, ID_START_LETTER, IDENT, IMPLIED_FROM, IN, IN_LIST, INDEX_OP, INDICES, INNER, INSERT, INTO, IS, IS_NOT_NULL, IS_NULL, JAVA_CONSTANT, JOIN, JOIN_FRAGMENT, KEY, LE, LEADING, LEFT, LEFT_OUTER, LIKE, LITERAL_ascending, LITERAL_by, LITERAL_descending, LT, MAX, MEMBER, METHOD_CALL, METHOD_NAME, MIN, MINUS, MOD, NAMED_PARAM, NE, NEW, NOT, NOT_BETWEEN, NOT_IN, NOT_LIKE, NULL, NULL_TREE_LOOKAHEAD, NUM_BIG_DECIMAL, NUM_BIG_INTEGER, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, OBJECT, OF, ON, OPEN, OPEN_BRACKET, OR, ORDER, ORDER_ELEMENT, OUTER, PARAM, PLUS, PROPERTIES, PROPERTY_REF, QUERY, QUOTED_STRING, RANGE, RESULT_VARIABLE_REF, RIGHT, RIGHT_OUTER, ROW_STAR, SELECT, SELECT_CLAUSE, SELECT_COLUMNS, SELECT_EXPR, SELECT_FROM, SET, SOME, SQL_NE, SQL_TOKEN, STAR, SUM, THEN, THETA_JOINS, TRAILING, TRUE, UNARY_MINUS, UNARY_PLUS, UNION, UPDATE, VALUE, VECTOR_EXPR, VERSIONED, WEIRD_IDENT, WHEN, WHERE, WITH, WS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFromElement(String path, antlr.collections.AST alias) Adds a new from element to the from node.voidaddImpliedFromElement(FromElement element) booleancontainsClassAlias(String alias) Returns true if the from node contains the class alias name.booleancontainsTableAlias(String alias) Returns true if the from node contains the table alias name.findFromElementBySqlAlias(String sqlAlias) findFromElementByUserOrSqlAlias(String userAlias, String sqlAlias) Returns additional display text for the AST node.getFromElement(String aliasOrClassName) Retreives the from-element represented by the given alias.Returns the list of from elements in order.intgetLevel()Returns the list of from elements that will be part of the result set.booleanbooleanisFromElementAlias(String possibleAlias) Convenience method to check whether a given token represents a from-element alias.booleanintvoidpromoteJoin(FromElement elem) voidresolve()voidsetParentFromClause(FromClause parentFromClause) toString()Methods inherited from class org.hibernate.hql.ast.tree.HqlSqlWalkerNode
getAliasGenerator, getASTFactory, getSessionFactoryHelper, getWalker, initializeMethods inherited from class org.hibernate.hql.ast.tree.SqlNode
getDataType, getOriginalText, setDataType, setTextMethods inherited from class org.hibernate.hql.ast.tree.Node
getColumn, getFilename, getLine, getRenderText, getTextLength, initialize, initializeMethods inherited from class antlr.CommonAST
getText, getType, initialize, setTypeMethods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
-
Field Details
-
ROOT_LEVEL
public static final int ROOT_LEVEL- See Also:
-
-
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
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
-
findFromElementByUserOrSqlAlias
-
isFromElementAlias
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
Returns the list of from elements in order.- Returns:
- the list of from elements (instances of FromElement).
-
getFromElement
-
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
-
hasCollectionFecthes
public boolean hasCollectionFecthes() -
getExplicitFromElements
-
containsClassAlias
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
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
Description copied from interface:DisplayableNodeReturns additional display text for the AST node.- Specified by:
getDisplayTextin interfaceDisplayableNode- Returns:
- String - The additional display text.
-
setParentFromClause
-
locateChildFromClauseWithJoinByPath
-
promoteJoin
-
isSubQuery
public boolean isSubQuery() -
getParentFromClause
-
getLevel
public int getLevel() -
nextFromElementCounter
public int nextFromElementCounter() -
resolve
public void resolve() -
addImpliedFromElement
-
toString
- Specified by:
toStringin interfaceantlr.collections.AST- Overrides:
toStringin classantlr.BaseAST
-