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(java.lang.String newVariableName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)INTERNAL Apply this node to the passed queryExpressiongenerateBaseBuilderExpression(GenerationContext context)ExpressiongenerateExpression(GenerationContext generationContext)INTERNAL Generate an expression for the node.ExpressiongenerateExpressionForAlias(GenerationContext context)java.lang.StringgetAsString()INTERNAL Get the string representation of this node.java.lang.StringgetCanonicalVariableName()NodegetNodeForAlias(GenerationContext context)java.lang.ObjectgetTypeForMapKey(ParseTreeContext context)java.lang.StringgetVariableName()booleanisAlias(GenerationContext context)isAlias: Answer true if this variable represents an alias in the FROM clause.booleanisAlias(ParseTreeContext context)booleanisAliasableNode()booleanisVariableNode()INTERNAL Is this node a VariableNodeNodequalifyAttributeAccess(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.java.lang.ClassresolveClass(GenerationContext generationContext)resolveClass: Answer the class which corresponds to my variableName.voidsetVariableName(java.lang.String newVariableName)java.lang.StringtoString(int indent)voidvalidate(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
-
-
-
-
Method Detail
-
getVariableName
public java.lang.String getVariableName()
-
setVariableName
public void setVariableName(java.lang.String newVariableName)
-
getCanonicalVariableName
public java.lang.String getCanonicalVariableName()
-
isVariableNode
public boolean isVariableNode()
INTERNAL Is this node a VariableNode- Overrides:
isVariableNodein classNode
-
applyToQuery
public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext generationContext)
INTERNAL Apply this node to the passed query- Overrides:
applyToQueryin 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:
qualifyAttributeAccessin 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:NodeINTERNAL Generate an expression for the node. Each subclass will generate a different expression and thus will need to override this method- Overrides:
generateExpressionin 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 java.lang.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:
resolveClassin classNode
-
getAsString
public java.lang.String getAsString()
INTERNAL Get the string representation of this node.- Overrides:
getAsStringin classNode
-
getTypeForMapKey
public java.lang.Object getTypeForMapKey(ParseTreeContext context)
-
isAliasableNode
public boolean isAliasableNode()
- Overrides:
isAliasableNodein classNode
-
-