Top Description Fields Constructors Methods
org.hibernate.hql.ast.tree

public Class FromClause

extends HqlSqlWalkerNode
implements HqlSqlTokenTypes, DisplayableNode
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.ast.tree.DisplayableNode, org.hibernate.hql.antlr.HqlSqlTokenTypes
Imports
java.util.HashMap, .HashSet, .Iterator, .LinkedList, .List, .Map, .Set, org.slf4j.Logger, .LoggerFactory, org.hibernate.hql.antlr.HqlSqlTokenTypes, org.hibernate.hql.ast.util.ASTIterator, .ASTUtil, antlr.SemanticException, antlr.collections.AST

Represents the 'FROM' part of a query or subquery, containing all mapped class references.
Author
josh

Field Summary

Modifier and TypeField and Description
private Set<E>
childFromClauses

Collection of FROM clauses of which this is the parent.

private static ASTUtil.FilterPredicate
private Map<K, V>
collectionJoinFromElementsByPath

All of the implicit FROM xxx JOIN yyy elements that are the destination of a collection.

private static ASTUtil.FilterPredicate
private Map<K, V>
private Map<K, V>
private int
fromElementCounter

Counts the from elements as they are added.

private static ASTUtil.FilterPredicate
private Set<E>
private Map<K, V>
private List<E>
impliedElements

Implied FROM elements to add onto the end of the FROM clause.

private int
private static Logger
private FromClause
parentFromClause

Pointer to the parent FROM clause, if there is one.

private static ASTUtil.FilterPredicate
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addChild(FromClause fromClause)

pack-priv void
addCollectionJoinFromElementByPath(String path, FromElement destination)

Deprecated as a consequence of FromElement being deprecated.
pack-priv void
addDuplicateAlias(String alias, FromElement element)

Deprecated as a consequence of FromElement being deprecated.
public FromElement

Returns:

FromElement - The new FROM element.
addFromElement
(String
The reference to the class.
path
,
AST
The alias AST.
alias
)

Deprecated as a consequence of FromElement being deprecated.
Adds a new from element to the from node.
public void
addImpliedFromElement(FromElement element)

Deprecated as a consequence of FromElement being deprecated.
pack-priv void
addJoinByPathMap(String path, FromElement destination)

Deprecated as a consequence of FromElement being deprecated.
private void
public boolean

Returns:

true if the from node contains the class alias name.
containsClassAlias
(String
The HQL class alias name.
alias
)

Returns true if the from node contains the class alias name.

public boolean

Returns:

true if the from node contains the table alias name.
containsTableAlias
(String
The SQL table alias name.
alias
)

Returns true if the from node contains the table alias name.

pack-priv FromElement
findCollectionJoin(String path)

Deprecated as a consequence of FromElement being deprecated.
public FromElement
findFromElementBySqlAlias(String sqlAlias)

Deprecated as a consequence of FromElement being deprecated.
public FromElement
findFromElementByUserOrSqlAlias(String userAlias, String sqlAlias)

Deprecated as a consequence of FromElement being deprecated.
private FromElement
findIntendedAliasedFromElementBasedOnCrazyJPARequirements(String specifiedAlias)

Deprecated as a consequence of FromElement being deprecated.
pack-priv FromElement
findJoinByPath(String path)

Deprecated as a consequence of FromElement being deprecated.
Look for an existing implicit or explicit join by the given path.
pack-priv FromElement
findJoinByPathLocal(String path)

Deprecated as a consequence of FromElement being deprecated.
public List<E>
public String
getDisplayText()

Implements org.hibernate.hql.ast.tree.DisplayableNode.getDisplayText.

Returns additional display text for the AST node.
public List<E>
public FromElement

Returns:

The from-element assigned the given alias, or null if none.
getFromElement
(String
The alias by which to locate the from-element.
aliasOrClassName
)

Deprecated as a consequence of FromElement being deprecated.
Retreives the from-element represented by the given alias.
public FromElement
getFromElement()

Deprecated as a consequence of FromElement being deprecated.
public List<E>

Returns:

the list of from elements (instances of FromElement).
getFromElements
()

Returns the list of from elements in order.

public int
public FromClause
public List<E>

Returns:

the list of from elements that will be part of the result set.
getProjectionList
()

Returns the list of from elements that will be part of the result set.

public boolean
public boolean

Returns:

True if the possibleAlias is an alias to a from-element visible from this point in the query graph.
isFromElementAlias
(String
The potential from-element alias to check.
possibleAlias
)

Convenience method to check whether a given token represents a from-element alias.

public boolean
public FromClause
public int
public void
promoteJoin(FromElement elem)

Deprecated as a consequence of FromElement being deprecated.
pack-priv void
registerFromElement(FromElement element)

Deprecated as a consequence of FromElement being deprecated.
public void
public void
setParentFromClause(FromClause parentFromClause)

public String
toString()

Overrides antlr.BaseAST.toString.

Implements antlr.collections.AST.toString.

Returns a string representation of the object.
Inherited from org.hibernate.hql.ast.tree.HqlSqlWalkerNode:
getAliasGeneratorgetASTFactorygetSessionFactoryHelpergetWalkerinitialize

Field Detail

childFromClausesback to summary
private Set<E> childFromClauses

Collection of FROM clauses of which this is the parent.

collectionFetchPredicateback to summary
private static ASTUtil.FilterPredicate collectionFetchPredicate
collectionJoinFromElementsByPathback to summary
private Map<K, V> collectionJoinFromElementsByPath

All of the implicit FROM xxx JOIN yyy elements that are the destination of a collection. These are created from index operators on collection property references.

explicitFromPredicateback to summary
private static ASTUtil.FilterPredicate explicitFromPredicate
fromElementByClassAliasback to summary
private Map<K, V> fromElementByClassAlias
fromElementByTableAliasback to summary
private Map<K, V> fromElementByTableAlias
fromElementCounterback to summary
private int fromElementCounter

Counts the from elements as they are added.

fromElementPredicateback to summary
private static ASTUtil.FilterPredicate fromElementPredicate
fromElementsback to summary
private Set<E> fromElements
fromElementsByPathback to summary
private Map<K, V> fromElementsByPath
impliedElementsback to summary
private List<E> impliedElements

Implied FROM elements to add onto the end of the FROM clause.

levelback to summary
private int level
logback to summary
private static Logger log
parentFromClauseback to summary
private FromClause parentFromClause

Pointer to the parent FROM clause, if there is one.

projectionListPredicateback to summary
private static ASTUtil.FilterPredicate projectionListPredicate
ROOT_LEVELback to summary
public static final int ROOT_LEVEL

Constructor Detail

FromClauseback to summary
public FromClause()

Method Detail

addChildback to summary
private void addChild(FromClause fromClause)
addCollectionJoinFromElementByPathback to summary
pack-priv void addCollectionJoinFromElementByPath(String path, FromElement destination)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

addDuplicateAliasback to summary
pack-priv void addDuplicateAlias(String alias, FromElement element)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

addFromElementback to summary
public FromElement addFromElement(String path, AST alias) throws SemanticException

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

Adds a new from element to the from node.

Parameters
path:String

The reference to the class.

alias:AST

The alias AST.

Returns:FromElement

FromElement - The new FROM element.

addImpliedFromElementback to summary
public void addImpliedFromElement(FromElement element)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

addJoinByPathMapback to summary
pack-priv void addJoinByPathMap(String path, FromElement destination)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

checkForDuplicateClassAliasback to summary
private void checkForDuplicateClassAlias(String classAlias) throws SemanticException
containsClassAliasback to summary
public boolean containsClassAlias(String alias)

Returns true if the from node contains the class alias name.

Parameters
alias:String

The HQL class alias name.

Returns:boolean

true if the from node contains the class alias name.

containsTableAliasback to summary
public boolean containsTableAlias(String alias)

Returns true if the from node contains the table alias name.

Parameters
alias:String

The SQL table alias name.

Returns:boolean

true if the from node contains the table alias name.

findCollectionJoinback to summary
pack-priv FromElement findCollectionJoin(String path)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

findFromElementBySqlAliasback to summary
public FromElement findFromElementBySqlAlias(String sqlAlias)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

findFromElementByUserOrSqlAliasback to summary
public FromElement findFromElementByUserOrSqlAlias(String userAlias, String sqlAlias)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

findIntendedAliasedFromElementBasedOnCrazyJPARequirementsback to summary
private FromElement findIntendedAliasedFromElementBasedOnCrazyJPARequirements(String specifiedAlias)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

findJoinByPathback to summary
pack-priv FromElement findJoinByPath(String path)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

Look for an existing implicit or explicit join by the given path.

findJoinByPathLocalback to summary
pack-priv FromElement findJoinByPathLocal(String path)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

getCollectionFetchesback to summary
public List<E> getCollectionFetches()
getDisplayTextback to summary
public String getDisplayText()

Implements org.hibernate.hql.ast.tree.DisplayableNode.getDisplayText.

Doc from org.hibernate.hql.ast.tree.DisplayableNode.getDisplayText.

Returns additional display text for the AST node.

Returns:String

String - The additional display text.

getExplicitFromElementsback to summary
public List<E> getExplicitFromElements()
getFromElementback to summary
public FromElement getFromElement(String aliasOrClassName)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

Retreives the from-element represented by the given alias.

Parameters
aliasOrClassName:String

The alias by which to locate the from-element.

Returns:FromElement

The from-element assigned the given alias, or null if none.

getFromElementback to summary
public FromElement getFromElement()

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

getFromElementsback to summary
public List<E> getFromElements()

Returns the list of from elements in order.

Returns:List<E>

the list of from elements (instances of FromElement).

getLevelback to summary
public int getLevel()
getParentFromClauseback to summary
public FromClause getParentFromClause()
getProjectionListback to summary
public List<E> getProjectionList()

Returns the list of from elements that will be part of the result set.

Returns:List<E>

the list of from elements that will be part of the result set.

hasCollectionFecthesback to summary
public boolean hasCollectionFecthes()
isFromElementAliasback to summary
public boolean isFromElementAlias(String possibleAlias)

Convenience method to check whether a given token represents a from-element alias.

Parameters
possibleAlias:String

The potential from-element alias to check.

Returns:boolean

True if the possibleAlias is an alias to a from-element visible from this point in the query graph.

isSubQueryback to summary
public boolean isSubQuery()
locateChildFromClauseWithJoinByPathback to summary
public FromClause locateChildFromClauseWithJoinByPath(String path)
nextFromElementCounterback to summary
public int nextFromElementCounter()
promoteJoinback to summary
public void promoteJoin(FromElement elem)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

registerFromElementback to summary
pack-priv void registerFromElement(FromElement element)

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

resolveback to summary
public void resolve()
setParentFromClauseback to summary
public void setParentFromClause(FromClause parentFromClause)
toStringback to summary
public String toString()

Overrides antlr.BaseAST.toString.

Implements antlr.collections.AST.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.