public class ParseTree
extends java.lang.Object
Purpose: A ParseTree contains Node(s). This contains a root Node and provides traversal utilities.
Responsibilities:
Constructor and Description |
---|
ParseTree()
Return a new ParseTree.
|
Modifier and Type | Method and Description |
---|---|
void |
addGroupingToQuery(ObjectLevelReadQuery theQuery,
GenerationContext generationContext)
INTERNAL
Add the grouping to the passed query
|
void |
addHavingToQuery(ObjectLevelReadQuery theQuery,
GenerationContext generationContext)
INTERNAL
Add the having to the passed query
|
void |
addNonFetchJoinAttributes(ObjectLevelReadQuery theQuery,
GenerationContext generationContext)
INTERNAL
|
void |
addOrderingToQuery(ObjectLevelReadQuery theQuery,
GenerationContext generationContext)
INTERNAL
Add the ordering to the passed query
|
void |
addParametersToQuery(DatabaseQuery query)
INTERNAL
Add parameters to the query
|
void |
addUpdatesToQuery(UpdateAllQuery theQuery,
GenerationContext generationContext)
INTERNAL
Add the updates to the passed query
|
void |
adjustReferenceClassForQuery(DatabaseQuery theQuery,
GenerationContext generationContext)
INTERNAL
Adjust the reference class of the passed query if necessary
Need to test this for Employee, employee.getAddress(), report query
|
void |
applyQueryNodeToQuery(DatabaseQuery theQuery,
GenerationContext generationContext)
INTERNAL
Apply the select or update to the passed query.
|
GenerationContext |
buildContext(DatabaseQuery query,
AbstractSession sessionForContext)
INTERNAL
Build the context to be used when generating the expression from the parse tree
|
GenerationContext |
buildContextForReadQuery(AbstractSession sessionForContext)
INTERNAL
Build the context to be used when generating the expression from the parse tree
|
DatabaseQuery |
createDatabaseQuery()
INTERNAL
Returns a DatabaseQuery instance for this ParseTree.
|
Expression |
generateExpression(DatabaseQuery readQuery,
GenerationContext generationContext)
INTERNAL
Build a context for the expression generation
|
java.lang.ClassLoader |
getClassLoader()
INTERNAL
Return a class loader
|
ParseTreeContext |
getContext()
Return the context for this parse tree
|
short |
getDistinctState()
INTERNAL
Return the DISTINCT state for the tree
|
FromNode |
getFromNode()
INTERNAL
Return the FROM Node
|
GroupByNode |
getGroupByNode()
INTERNAL
Return the GroupByNode
|
HavingNode |
getHavingNode()
INTERNAL
Return the HavingNode
|
OrderByNode |
getOrderByNode()
INTERNAL
Return the OrderByNode
|
QueryNode |
getQueryNode()
INTERNAL
Return the root node for the tree
|
java.lang.Class |
getReferenceClass(DatabaseQuery query,
GenerationContext generationContext)
getReferenceClass(): Answer the class which will be the reference class for the query.
|
SetNode |
getSetNode()
INTERNAL
Return the set node for the tree
|
WhereNode |
getWhereNode()
INTERNAL
Return the Where node
|
boolean |
hasGroupBy()
INTERNAL
Does this EJBQL have a Grouping Clause
|
boolean |
hasHaving()
INTERNAL
Does this EJBQL have a Having Clause
|
boolean |
hasOrderBy()
INTERNAL
Does this EJBQL have an Ordering Clause
|
void |
initBaseExpression(ModifyAllQuery theQuery,
GenerationContext generationContext)
INTERNAL
Initialize the base expression in the generation context.
|
void |
initBaseExpression(ObjectLevelReadQuery theQuery,
GenerationContext generationContext)
INTERNAL
Initialize the base expression in the generation context.
|
void |
setClassLoader(java.lang.ClassLoader loader)
INTERNAL:
Set the class loader for this parse tree
|
void |
setContext(ParseTreeContext newContext)
INTERNAL
Set the context for this parse tree
|
void |
setDistinctState(short newDistinctState)
INTERNAL
Set the DISTINCT state for the tree
|
void |
setFromNode(FromNode fromNode)
INTERNAL
Set the FROM node for the query
|
void |
setGroupByNode(GroupByNode newGroupByNode)
INTERNAL
Set the Group by node
|
void |
setHavingNode(HavingNode newHavingNode)
INTERNAL
Set the Having node
|
void |
setOrderByNode(OrderByNode newOrderByNode)
INTERNAL
Set the Order by node
|
void |
setQueryNode(QueryNode newQueryNode)
INTERNAL
Set the Select node
|
void |
setSelectionCriteriaForQuery(DatabaseQuery theQuery,
GenerationContext generationContext) |
void |
setSetNode(SetNode newSetNode)
INTERNAL
Set the Where node
|
void |
setWhereNode(WhereNode newWhereNode)
INTERNAL
Set the Where node
|
java.lang.String |
toString()
INTERNAL
Print the contents of the parse tree on a string
|
boolean |
usesDistinct()
INTERNAL
Answer true if DISTINCT has been chosen.
|
void |
validate(ParseTreeContext context)
INTERNAL
Validate the parse tree.
|
void |
validate(TypeHelper typeHelper)
INTERNAL
Validate the parse tree.
|
void |
verifySelect(DatabaseQuery theQuery,
GenerationContext generationContext)
INTERNAL
Verify that the alias in the SELECT is valid.
|
public DatabaseQuery createDatabaseQuery()
public void adjustReferenceClassForQuery(DatabaseQuery theQuery, GenerationContext generationContext)
public void initBaseExpression(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
public void initBaseExpression(ModifyAllQuery theQuery, GenerationContext generationContext)
public void validate(TypeHelper typeHelper)
public void validate(ParseTreeContext context)
public void addOrderingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
public void addGroupingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
public void addHavingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
public void addNonFetchJoinAttributes(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
public void addUpdatesToQuery(UpdateAllQuery theQuery, GenerationContext generationContext)
public void addParametersToQuery(DatabaseQuery query)
public void applyQueryNodeToQuery(DatabaseQuery theQuery, GenerationContext generationContext)
public GenerationContext buildContext(DatabaseQuery query, AbstractSession sessionForContext)
public GenerationContext buildContextForReadQuery(AbstractSession sessionForContext)
public Expression generateExpression(DatabaseQuery readQuery, GenerationContext generationContext)
public ParseTreeContext getContext()
public FromNode getFromNode()
public java.lang.ClassLoader getClassLoader()
public OrderByNode getOrderByNode()
public GroupByNode getGroupByNode()
public HavingNode getHavingNode()
public java.lang.Class getReferenceClass(DatabaseQuery query, GenerationContext generationContext)
public QueryNode getQueryNode()
public SetNode getSetNode()
public WhereNode getWhereNode()
public short getDistinctState()
public boolean hasOrderBy()
public boolean hasGroupBy()
public boolean hasHaving()
public void setClassLoader(java.lang.ClassLoader loader)
loader
- public void setContext(ParseTreeContext newContext)
public void setFromNode(FromNode fromNode)
public void setOrderByNode(OrderByNode newOrderByNode)
public void setGroupByNode(GroupByNode newGroupByNode)
public void setHavingNode(HavingNode newHavingNode)
public void setSelectionCriteriaForQuery(DatabaseQuery theQuery, GenerationContext generationContext)
public void setQueryNode(QueryNode newQueryNode)
public void setSetNode(SetNode newSetNode)
public void setWhereNode(WhereNode newWhereNode)
public void setDistinctState(short newDistinctState)
public java.lang.String toString()
toString
in class java.lang.Object
public void verifySelect(DatabaseQuery theQuery, GenerationContext generationContext)
public boolean usesDistinct()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference