| java.lang.Object oracle.toplink.essentials.internal.parsing.ParseTree
All known Subclasses: oracle.toplink.essentials.internal.parsing.EJBQLParseTree,
ParseTree | public class ParseTree (Code) | | INTERNAL
Purpose: A ParseTree contains Node(s). This contains a root Node and provides traversal utilities.
Responsibilities:
- Add parameters to the query
- Generate an expression for the query
- Answer true if the tree has parameters
- Maintain the primary class name for the query
- Maintain the root of the parse tree
- Maintain the context for the parse tree
- Maintainthe distinct state for the parse tree
- Print the contents of the parse tree on a string
author: Jon Driscoll and Joel Lucuik since: TopLink 4.0 |
Constructor Summary | |
public | ParseTree() Return a new ParseTree. |
Method Summary | |
public void | addGroupingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext) | public void | addHavingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext) | public void | addNonFetchJoinAttributes(ObjectLevelReadQuery theQuery, GenerationContext generationContext) | public void | addOrderingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext) | public void | addParametersToQuery(DatabaseQuery query) | public void | addUpdatesToQuery(UpdateAllQuery theQuery, GenerationContext generationContext) | public void | adjustReferenceClassForQuery(DatabaseQuery theQuery, GenerationContext generationContext) | public void | applyQueryNodeToQuery(DatabaseQuery theQuery, GenerationContext generationContext) INTERNAL
Apply the select or update to the passed query. | public GenerationContext | buildContext(DatabaseQuery query, AbstractSession sessionForContext) | public GenerationContext | buildContextForReadQuery(AbstractSession sessionForContext) | public DatabaseQuery | createDatabaseQuery() INTERNAL
Returns a DatabaseQuery instance for this ParseTree. | public Expression | generateExpression(DatabaseQuery readQuery, GenerationContext generationContext) | public ClassLoader | getClassLoader() | public ParseTreeContext | getContext() | public short | getDistinctState() | public FromNode | getFromNode() | public GroupByNode | getGroupByNode() | public HavingNode | getHavingNode() | public OrderByNode | getOrderByNode() | public QueryNode | getQueryNode() | public Class | getReferenceClass(DatabaseQuery query, GenerationContext generationContext) getReferenceClass(): Answer the class which will be the reference class for the query. | public SetNode | getSetNode() | public WhereNode | getWhereNode() | public boolean | hasGroupBy() | public boolean | hasHaving() | public boolean | hasOrderBy() | public void | initBaseExpression(ObjectLevelReadQuery theQuery, GenerationContext generationContext) INTERNAL
Initialize the base expression in the generation context. | public void | initBaseExpression(ModifyAllQuery theQuery, GenerationContext generationContext) INTERNAL
Initialize the base expression in the generation context. | protected void | qualifyAttributeAccess(ParseTreeContext context) INTERNAL
This method handles any unqualified field access in bulk UPDATE and
DELETE statements. | public void | setClassLoader(ClassLoader loader) | public void | setContext(ParseTreeContext newContext) | public void | setDistinctState(short newDistinctState) | public void | setFromNode(FromNode fromNode) | public void | setGroupByNode(GroupByNode newGroupByNode) | public void | setHavingNode(HavingNode newHavingNode) | public void | setOrderByNode(OrderByNode newOrderByNode) | public void | setQueryNode(QueryNode newQueryNode) | public void | setSelectionCriteriaForQuery(DatabaseQuery theQuery, GenerationContext generationContext) | public void | setSetNode(SetNode newSetNode) | public void | setWhereNode(WhereNode newWhereNode) | public String | toString() | public boolean | usesDistinct() INTERNAL
Answer true if DISTINCT has been chosen. | protected void | validate(AbstractSession session, ClassLoader classLoader) INTERNAL
Validate the parse tree. | public void | validate(TypeHelper typeHelper) INTERNAL
Validate the parse tree. | public void | validate(ParseTreeContext context) INTERNAL
Validate the parse tree. | public void | verifySelect(DatabaseQuery theQuery, GenerationContext generationContext) INTERNAL
Verify that the alias in the SELECT is valid. |
ParseTree | public ParseTree()(Code) | | Return a new ParseTree.
|
addParametersToQuery | public void addParametersToQuery(DatabaseQuery query)(Code) | | INTERNAL
Add parameters to the query
|
adjustReferenceClassForQuery | public void adjustReferenceClassForQuery(DatabaseQuery theQuery, GenerationContext generationContext)(Code) | | INTERNAL
Adjust the reference class of the passed query if necessary
Need to test this for Employee, employee.getAddress(), report query
|
applyQueryNodeToQuery | public void applyQueryNodeToQuery(DatabaseQuery theQuery, GenerationContext generationContext)(Code) | | INTERNAL
Apply the select or update to the passed query.
If there is a single attribute being selected, add it to the query result set
If an aggregate is being used, add it to the query result set
|
buildContextForReadQuery | public GenerationContext buildContextForReadQuery(AbstractSession sessionForContext)(Code) | | INTERNAL
Build the context to be used when generating the expression from the parse tree
|
createDatabaseQuery | public DatabaseQuery createDatabaseQuery()(Code) | | INTERNAL
Returns a DatabaseQuery instance for this ParseTree.
|
getClassLoader | public ClassLoader getClassLoader()(Code) | | INTERNAL
Return a class loader
java.lang.ClassLoader |
getDistinctState | public short getDistinctState()(Code) | | INTERNAL
Return the DISTINCT state for the tree
|
getFromNode | public FromNode getFromNode()(Code) | | INTERNAL
Return the FROM Node
|
getGroupByNode | public GroupByNode getGroupByNode()(Code) | | INTERNAL
Return the GroupByNode
|
getHavingNode | public HavingNode getHavingNode()(Code) | | INTERNAL
Return the HavingNode
|
getOrderByNode | public OrderByNode getOrderByNode()(Code) | | INTERNAL
Return the OrderByNode
|
getQueryNode | public QueryNode getQueryNode()(Code) | | INTERNAL
Return the root node for the tree
|
getReferenceClass | public Class getReferenceClass(DatabaseQuery query, GenerationContext generationContext)(Code) | | getReferenceClass(): Answer the class which will be the reference class for the query.
Resolve this using the node parsed from the "SELECT" of the EJBQL query string
|
getSetNode | public SetNode getSetNode()(Code) | | INTERNAL
Return the set node for the tree
|
getWhereNode | public WhereNode getWhereNode()(Code) | | INTERNAL
Return the Where node
|
hasGroupBy | public boolean hasGroupBy()(Code) | | INTERNAL
Does this EJBQL have a Grouping Clause
|
hasHaving | public boolean hasHaving()(Code) | | INTERNAL
Does this EJBQL have a Having Clause
|
hasOrderBy | public boolean hasOrderBy()(Code) | | INTERNAL
Does this EJBQL have an Ordering Clause
|
qualifyAttributeAccess | protected void qualifyAttributeAccess(ParseTreeContext context)(Code) | | INTERNAL
This method handles any unqualified field access in bulk UPDATE and
DELETE statements. A UPDATE or DELETE statement may not define an
identification variable. In this case any field accessed from the
current class is not qualified with an identification variable, e.g.
UPDATE Customer SET name = :newname
The method goes through the expressions of the SET clause and the WHERE
clause of such an DELETE and UPDATE statement and qualifies the field
access using the abstract schema name as qualifier.
|
setClassLoader | public void setClassLoader(ClassLoader loader)(Code) | | INTERNAL:
Set the class loader for this parse tree
Parameters: loader - |
setContext | public void setContext(ParseTreeContext newContext)(Code) | | INTERNAL
Set the context for this parse tree
|
setDistinctState | public void setDistinctState(short newDistinctState)(Code) | | INTERNAL
Set the DISTINCT state for the tree
|
setFromNode | public void setFromNode(FromNode fromNode)(Code) | | INTERNAL
Set the FROM node for the query
|
setGroupByNode | public void setGroupByNode(GroupByNode newGroupByNode)(Code) | | INTERNAL
Set the Group by node
|
setHavingNode | public void setHavingNode(HavingNode newHavingNode)(Code) | | INTERNAL
Set the Having node
|
setOrderByNode | public void setOrderByNode(OrderByNode newOrderByNode)(Code) | | INTERNAL
Set the Order by node
|
setQueryNode | public void setQueryNode(QueryNode newQueryNode)(Code) | | INTERNAL
Set the Select node
|
setSetNode | public void setSetNode(SetNode newSetNode)(Code) | | INTERNAL
Set the Where node
|
setWhereNode | public void setWhereNode(WhereNode newWhereNode)(Code) | | INTERNAL
Set the Where node
|
toString | public String toString()(Code) | | INTERNAL
Print the contents of the parse tree on a string
|
usesDistinct | public boolean usesDistinct()(Code) | | INTERNAL
Answer true if DISTINCT has been chosen.
|
validate | public void validate(TypeHelper typeHelper)(Code) | | INTERNAL
Validate the parse tree.
|
verifySelect | public void verifySelect(DatabaseQuery theQuery, GenerationContext generationContext)(Code) | | INTERNAL
Verify that the alias in the SELECT is valid.
Invalid: SELECT OBJECT(badAlias) FROM Employee employee....
Valid: SELECT OBJECT(employee) FROM Employee employee....
|
|
|