Class VariableNode
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.parsing.Node
-
- org.eclipse.persistence.internal.jpa.parsing.VariableNode
-
- All Implemented Interfaces:
AliasableNode
public class VariableNode extends Node implements AliasableNode
INTERNALPurpose: The node that represents typed variables, local variables, remote variables and TYPE constants.
- Since:
- TopLink 4.0
- Author:
- Jon Driscoll and Joel Lucuik
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.jpa.parsing.Node
alias, left, right, shouldGenerateExpression
-
-
Constructor Summary
Constructors Constructor Description VariableNode()
VariableNode constructor comment.VariableNode(String newVariableName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
INTERNAL Apply this node to the passed queryExpression
generateBaseBuilderExpression(GenerationContext context)
Expression
generateExpression(GenerationContext generationContext)
INTERNAL Generate an expression for the node.Expression
generateExpressionForAlias(GenerationContext context)
String
getAsString()
INTERNAL Get the string representation of this node.String
getCanonicalVariableName()
Node
getNodeForAlias(GenerationContext context)
Object
getTypeForMapKey(ParseTreeContext context)
String
getVariableName()
boolean
isAlias(GenerationContext context)
isAlias: Answer true if this variable represents an alias in the FROM clause.boolean
isAlias(ParseTreeContext context)
boolean
isAliasableNode()
boolean
isVariableNode()
INTERNAL Is this node a VariableNodeNode
qualifyAttributeAccess(ParseTreeContext context)
INTERNAL This node represent an unqualified field access in the case the method is called and the variableName is not defined as identification variable.Class
resolveClass(GenerationContext generationContext)
resolveClass: Answer the class which corresponds to my variableName.void
setVariableName(String newVariableName)
String
toString(int indent)
void
validate(ParseTreeContext context)
INTERNAL Validate node and calculate its type.-
Methods inherited from class org.eclipse.persistence.internal.jpa.parsing.Node
addToExpression, appendExpression, getAlias, getColumn, getLeft, getLine, getRight, getType, hasLeft, hasRight, isAggregateNode, isAttributeNode, isConstructorNode, isCountNode, isDivideNode, isDotNode, isEscape, isLiteralNode, isMapKeyNode, isMinusNode, isMultiplyNode, isNotNode, isParameterNode, isPlusNode, isSubqueryNode, resolveAttribute, resolveClass, resolveMapping, resolveMapping, setAlias, setColumn, setLeft, setLine, setRight, setType, toString, toStringDisplayName, toStringIndent, validateParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.internal.jpa.parsing.AliasableNode
getAlias, setAlias
-
-
-
-
Constructor Detail
-
VariableNode
public VariableNode()
VariableNode constructor comment.
-
VariableNode
public VariableNode(String newVariableName)
-
-
Method Detail
-
getVariableName
public String getVariableName()
-
setVariableName
public void setVariableName(String newVariableName)
-
getCanonicalVariableName
public String getCanonicalVariableName()
-
isVariableNode
public boolean isVariableNode()
INTERNAL Is this node a VariableNode- Overrides:
isVariableNode
in classNode
-
applyToQuery
public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
INTERNAL Apply this node to the passed query- Overrides:
applyToQuery
in classNode
-
qualifyAttributeAccess
public Node qualifyAttributeAccess(ParseTreeContext context)
INTERNAL This node represent an unqualified field access in the case the method is called and the variableName is not defined as identification variable. The method returns a DotNode representing a qualified field access with the base variable as left child node. The right child node is an AttributeNode using the variableName as field name.- Overrides:
qualifyAttributeAccess
in classNode
-
validate
public void validate(ParseTreeContext context)
INTERNAL Validate node and calculate its type.
-
generateBaseBuilderExpression
public Expression generateBaseBuilderExpression(GenerationContext context)
-
generateExpression
public Expression generateExpression(GenerationContext generationContext)
Description copied from class:Node
INTERNAL Generate an expression for the node. Each subclass will generate a different expression and thus will need to override this method- Overrides:
generateExpression
in classNode
-
generateExpressionForAlias
public Expression generateExpressionForAlias(GenerationContext context)
-
getNodeForAlias
public Node getNodeForAlias(GenerationContext context)
-
isAlias
public boolean isAlias(GenerationContext context)
isAlias: Answer true if this variable represents an alias in the FROM clause. i.e. "FROM Employee emp" declares "emp" as an alias
-
isAlias
public boolean isAlias(ParseTreeContext context)
-
resolveClass
public Class resolveClass(GenerationContext generationContext)
resolveClass: Answer the class which corresponds to my variableName. This is the class for an alias, where the variableName is registered to an alias.- Overrides:
resolveClass
in classNode
-
getAsString
public String getAsString()
INTERNAL Get the string representation of this node.- Overrides:
getAsString
in classNode
-
getTypeForMapKey
public Object getTypeForMapKey(ParseTreeContext context)
-
isAliasableNode
public boolean isAliasableNode()
- Overrides:
isAliasableNode
in classNode
-
-