Module org.eclipse.persistence.core
Class ParseTreeContext
java.lang.Object
org.eclipse.persistence.internal.jpa.parsing.ParseTreeContext
INTERNAL
Purpose: The ParseTreeContext holds and manages context information for the parse tree for validation.
Responsibilities:
- Associate schema names with variables
- Associate identifier with nodes
- Answer an alias for a variable name
- Answer a class for a variable name
- Answer a class loader
- Answer true if there is a class for a variable name
- Answer a node for a given identifier
- Print the context on a string
- Since:
- TopLink 4.0
- See Also:
-
Constructor Summary
ConstructorDescriptionParseTreeContext
(NodeFactory nodeFactory, String queryInfo) INTERNAL Return a new initialized ParseTreeContext -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(String parameterName) INTERNAL Add a parameter.Class
<?> classForSchemaName
(String schemaName, GenerationContext context) INTERNAL Answer the class associated with the provided schema namevoid
defineParameterType
(String parameterName, Object parameterType, int line, int column) INTERNAL Defines the type of the parameter with the specified name.void
INTERNAL Enters a new scope.getFetchJoins
(String variableName) Returns a list of FETCH JOIN nodes for the specified attached to the specified variable.INTERNAL Returns the set of outer scope variables.INTERNAL Return the parameter names.getParameterType
(String parameter) INTERNAL Return the type of the specified parameter.INTERNAL Returns the type helper stored in this context.Returns s set of variables that are declared in the current scope, but not used in the query.getVariableNameForClass
(Class<?> theClass, GenerationContext context) INTERNAL getVariableNameForClass(): Answer the name mapped to the specified class.boolean
boolean
boolean
INTERNAL Returns true if the query has at least one parameter.boolean
isDeclaredInOuterScope
(String variable) INTERNAL Returns true if the specified string denotes a variable declared in an outer scope.boolean
isRangeVariable
(String variable) INTERNAL Returns true if the specified string denotes a range variable.boolean
isVariable
(String variable) INTERNAL Returns true if the specified string denotes a variable.void
INTERNAL Leaves the current scope.pathForVariable
(String variable) INTERNAL Returns the path if the specified string denotes a join or collection member variable.void
registerFetchJoin
(String variableName, Node node) Associate the given variableName with the given node representing a JOIN FETCH node.void
registerJoinVariable
(String variable, Node path, int line, int column) INTERNAL Associate the given path with the given variable.void
registerOuterScopeVariable
(String variable) INTERNAL Adds the specified variable to the set of outer scope variables.void
registerSchema
(String variable, String schema, int line, int column) INTERNAL Associate the given schema with the given variable.void
INTERNAL Resets the set of outer scope variables.void
resetOuterScopeVariables
(Set<String> variables) INTERNAL Resets the set of outer scope variables.schemaForVariable
(String variable) INTERNAL Returns the abstract schema name if the specified string denotes a range variable.void
setBaseVariable
(String variable) void
setScopeOfVariable
(String variable) INTERNAL Sets the scope of the specified variable to the current scope.void
setTypeHelper
(TypeHelper typeHelper) INTERNAL Stores the specified type helper in this context.void
unregisterVariable
(String variable) INTERNALvoid
usedVariable
(String variable) Mark the specified variable as used if it is declared in the current scope.
-
Constructor Details
-
ParseTreeContext
INTERNAL Return a new initialized ParseTreeContext
-
-
Method Details
-
registerSchema
INTERNAL Associate the given schema with the given variable. -
registerJoinVariable
INTERNAL Associate the given path with the given variable. -
unregisterVariable
INTERNAL -
isVariable
INTERNAL Returns true if the specified string denotes a variable. -
isRangeVariable
INTERNAL Returns true if the specified string denotes a range variable. -
schemaForVariable
INTERNAL Returns the abstract schema name if the specified string denotes a range variable. -
classForSchemaName
INTERNAL Answer the class associated with the provided schema name -
getVariableNameForClass
INTERNAL getVariableNameForClass(): Answer the name mapped to the specified class. Answer null if none found. SELECT OBJECT (emp) FROM Employee emp getVariableNameForClass(Employee.class) => "emp" -
pathForVariable
INTERNAL Returns the path if the specified string denotes a join or collection member variable. -
getBaseVariable
-
setBaseVariable
-
getNodeFactory
-
getQueryInfo
-
isDeclaredInOuterScope
INTERNAL Returns true if the specified string denotes a variable declared in an outer scope. -
setScopeOfVariable
INTERNAL Sets the scope of the specified variable to the current scope. -
enterScope
public void enterScope()INTERNAL Enters a new scope. This initializes the set of outer scope variables. -
leaveScope
public void leaveScope()INTERNAL Leaves the current scope. -
registerOuterScopeVariable
INTERNAL Adds the specified variable to the set of outer scope variables. -
getOuterScopeVariables
INTERNAL Returns the set of outer scope variables. -
resetOuterScopeVariables
public void resetOuterScopeVariables()INTERNAL Resets the set of outer scope variables. -
resetOuterScopeVariables
INTERNAL Resets the set of outer scope variables. -
registerFetchJoin
Associate the given variableName with the given node representing a JOIN FETCH node. -
getFetchJoins
Returns a list of FETCH JOIN nodes for the specified attached to the specified variable. -
usedVariable
Mark the specified variable as used if it is declared in the current scope. -
getUnusedVariables
Returns s set of variables that are declared in the current scope, but not used in the query. -
hasMoreThanOneVariablePerType
public boolean hasMoreThanOneVariablePerType() -
hasMoreThanOneAliasInFrom
public boolean hasMoreThanOneAliasInFrom() -
getTypeHelper
INTERNAL Returns the type helper stored in this context. -
setTypeHelper
INTERNAL Stores the specified type helper in this context. -
addParameter
INTERNAL Add a parameter. -
defineParameterType
INTERNAL Defines the type of the parameter with the specified name. -
hasParameters
public boolean hasParameters()INTERNAL Returns true if the query has at least one parameter. -
getParameterType
INTERNAL Return the type of the specified parameter. -
getParameterNames
INTERNAL Return the parameter names.
-