Purpose: A ParseTree contains Node(s). This contains a root Node and provides traversal utilities.
Responsibilities:
| Modifier and Type | Field and Description |
|---|---|
| private ClassLoader | |
| private ParseTreeContext | |
| private short | |
| private FromNode | |
| private GroupByNode | |
| private HavingNode | |
| private OrderByNode | |
| private QueryNode | |
| private SetNode | |
| private Set | |
| private boolean | |
| private WhereNode |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addGroupingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
INTERNAL Add the grouping to the passed query |
| public void | addHavingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
INTERNAL Add the having to the passed query |
| public void | addNonFetchJoinAttributes(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
INTERNAL |
| public void | addOrderingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
INTERNAL Add the ordering to the passed query |
| public void | |
| public void | addUpdatesToQuery(UpdateAllQuery theQuery, GenerationContext generationContext)
INTERNAL Add the updates to the passed query |
| public 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 |
| public void | applyQueryNodeToQuery(DatabaseQuery theQuery, GenerationContext generationContext)
INTERNAL Apply the select or update to the passed query. |
| public GenerationContext | buildContext(DatabaseQuery query, AbstractSession sessionForContext)
INTERNAL Build the context to be used when generating the expression from the parse tree |
| public GenerationContext | buildContextForReadQuery(AbstractSession sessionForContext)
INTERNAL Build the context to be used when generating the expression from the parse tree |
| public DatabaseQuery | |
| public Expression | generateExpression(DatabaseQuery readQuery, GenerationContext generationContext)
INTERNAL Build a context for the expression generation |
| private Class | |
| public ClassLoader | |
| public ParseTreeContext | |
| public short | |
| public FromNode | |
| public GroupByNode | |
| public HavingNode | |
| public OrderByNode | |
| public QueryNode | |
| public Class | getReferenceClass(DatabaseQuery query, GenerationContext generationContext)
getReferenceClass(): Answer the class which will be the reference class for the query. |
| public SetNode | |
| public WhereNode | |
| public boolean | |
| public boolean | |
| public boolean | |
| 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 | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String | toString()
Overrides java. |
| public boolean | |
| protected void | |
| public void | |
| public void | |
| public void | verifySelect(DatabaseQuery theQuery, GenerationContext generationContext)
INTERNAL Verify that the alias in the SELECT is valid. |
| classLoader | back to summary |
|---|---|
| private ClassLoader classLoader | |
| context | back to summary |
|---|---|
| private ParseTreeContext context | |
| distinctState | back to summary |
|---|---|
| private short distinctState | |
| fromNode | back to summary |
|---|---|
| private FromNode fromNode | |
| groupByNode | back to summary |
|---|---|
| private GroupByNode groupByNode | |
| havingNode | back to summary |
|---|---|
| private HavingNode havingNode | |
| orderByNode | back to summary |
|---|---|
| private OrderByNode orderByNode | |
| queryNode | back to summary |
|---|---|
| private QueryNode queryNode | |
| setNode | back to summary |
|---|---|
| private SetNode setNode | |
| unusedVariables | back to summary |
|---|---|
| private Set<String> unusedVariables | |
| validated | back to summary |
|---|---|
| private boolean validated | |
| whereNode | back to summary |
|---|---|
| private WhereNode whereNode | |
| ParseTree | back to summary |
|---|---|
| public ParseTree() Return a new ParseTree. | |
| addGroupingToQuery | back to summary |
|---|---|
| public void addGroupingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext) INTERNAL Add the grouping to the passed query | |
| addHavingToQuery | back to summary |
|---|---|
| public void addHavingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext) INTERNAL Add the having to the passed query | |
| addNonFetchJoinAttributes | back to summary |
|---|---|
| public void addNonFetchJoinAttributes(ObjectLevelReadQuery theQuery, GenerationContext generationContext) INTERNAL | |
| addOrderingToQuery | back to summary |
|---|---|
| public void addOrderingToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext) INTERNAL Add the ordering to the passed query | |
| addParametersToQuery | back to summary |
|---|---|
| public void addParametersToQuery(DatabaseQuery query) INTERNAL Add parameters to the query | |
| addUpdatesToQuery | back to summary |
|---|---|
| public void addUpdatesToQuery(UpdateAllQuery theQuery, GenerationContext generationContext) INTERNAL Add the updates to the passed query | |
| adjustReferenceClassForQuery | back to summary |
|---|---|
| public 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 | |
| applyQueryNodeToQuery | back to summary |
|---|---|
| public void applyQueryNodeToQuery(DatabaseQuery theQuery, GenerationContext generationContext) 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 | |
| buildContext | back to summary |
|---|---|
| public GenerationContext buildContext(DatabaseQuery query, AbstractSession sessionForContext) INTERNAL Build the context to be used when generating the expression from the parse tree | |
| buildContextForReadQuery | back to summary |
|---|---|
| public GenerationContext buildContextForReadQuery(AbstractSession sessionForContext) INTERNAL Build the context to be used when generating the expression from the parse tree | |
| createDatabaseQuery | back to summary |
|---|---|
| public DatabaseQuery createDatabaseQuery() INTERNAL Returns a DatabaseQuery instance for this ParseTree. | |
| generateExpression | back to summary |
|---|---|
| public Expression generateExpression(DatabaseQuery readQuery, GenerationContext generationContext) INTERNAL Build a context for the expression generation | |
| getBaseExpressionClass | back to summary |
|---|---|
| private Class | |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() INTERNAL Return a class loader
| |
| getContext | back to summary |
|---|---|
| public ParseTreeContext getContext() Return the context for this parse tree | |
| getDistinctState | back to summary |
|---|---|
| public short getDistinctState() INTERNAL Return the DISTINCT state for the tree | |
| getFromNode | back to summary |
|---|---|
| public FromNode getFromNode() INTERNAL Return the FROM Node | |
| getGroupByNode | back to summary |
|---|---|
| public GroupByNode getGroupByNode() INTERNAL Return the GroupByNode | |
| getHavingNode | back to summary |
|---|---|
| public HavingNode getHavingNode() INTERNAL Return the HavingNode | |
| getOrderByNode | back to summary |
|---|---|
| public OrderByNode getOrderByNode() INTERNAL Return the OrderByNode | |
| getQueryNode | back to summary |
|---|---|
| public QueryNode getQueryNode() INTERNAL Return the root node for the tree | |
| getReferenceClass | back to summary |
|---|---|
| public Class 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 | back to summary |
|---|---|
| public SetNode getSetNode() INTERNAL Return the set node for the tree | |
| getWhereNode | back to summary |
|---|---|
| public WhereNode getWhereNode() INTERNAL Return the Where node | |
| hasGroupBy | back to summary |
|---|---|
| public boolean hasGroupBy() INTERNAL Does this EJBQL have a Grouping Clause | |
| hasHaving | back to summary |
|---|---|
| public boolean hasHaving() INTERNAL Does this EJBQL have a Having Clause | |
| hasOrderBy | back to summary |
|---|---|
| public boolean hasOrderBy() INTERNAL Does this EJBQL have an Ordering Clause | |
| initBaseExpression | back to summary |
|---|---|
| public void initBaseExpression(ObjectLevelReadQuery theQuery, GenerationContext generationContext) INTERNAL Initialize the base expression in the generation context. | |
| initBaseExpression | back to summary |
|---|---|
| public void initBaseExpression(ModifyAllQuery theQuery, GenerationContext generationContext) INTERNAL Initialize the base expression in the generation context. | |
| qualifyAttributeAccess | back to summary |
|---|---|
| protected void qualifyAttributeAccess(ParseTreeContext context) 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 | back to summary |
|---|---|
| public void setClassLoader(ClassLoader loader) INTERNAL: Set the class loader for this parse tree | |
| setContext | back to summary |
|---|---|
| public void setContext(ParseTreeContext newContext) INTERNAL Set the context for this parse tree | |
| setDistinctState | back to summary |
|---|---|
| public void setDistinctState(short newDistinctState) INTERNAL Set the DISTINCT state for the tree | |
| setFromNode | back to summary |
|---|---|
| public void setFromNode(FromNode fromNode) INTERNAL Set the FROM node for the query | |
| setGroupByNode | back to summary |
|---|---|
| public void setGroupByNode(GroupByNode newGroupByNode) INTERNAL Set the Group by node | |
| setHavingNode | back to summary |
|---|---|
| public void setHavingNode(HavingNode newHavingNode) INTERNAL Set the Having node | |
| setOrderByNode | back to summary |
|---|---|
| public void setOrderByNode(OrderByNode newOrderByNode) INTERNAL Set the Order by node | |
| setQueryNode | back to summary |
|---|---|
| public void setQueryNode(QueryNode newQueryNode) INTERNAL Set the Select node | |
| setSelectionCriteriaForQuery | back to summary |
|---|---|
| public void setSelectionCriteriaForQuery(DatabaseQuery theQuery, GenerationContext generationContext) | |
| setSetNode | back to summary |
|---|---|
| public void setSetNode(SetNode newSetNode) INTERNAL Set the Where node | |
| setWhereNode | back to summary |
|---|---|
| public void setWhereNode(WhereNode newWhereNode) INTERNAL Set the Where node | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. INTERNAL Print the contents of the parse tree on a string
| |
| usesDistinct | back to summary |
|---|---|
| public boolean usesDistinct() INTERNAL Answer true if DISTINCT has been chosen. | |
| validate | back to summary |
|---|---|
| protected void validate(AbstractSession session, ClassLoader classLoader) INTERNAL Validate the parse tree. | |
| validate | back to summary |
|---|---|
| public void validate(TypeHelper typeHelper) INTERNAL Validate the parse tree. | |
| validate | back to summary |
|---|---|
| public void validate(ParseTreeContext context) INTERNAL Validate the parse tree. | |
| verifySelect | back to summary |
|---|---|
| public void verifySelect(DatabaseQuery theQuery, GenerationContext generationContext) INTERNAL Verify that the alias in the SELECT is valid. Invalid: SELECT OBJECT(badAlias) FROM Employee employee.... Valid: SELECT OBJECT(employee) FROM Employee employee.... | |