Class DotNode
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.parsing.Node
-
- org.eclipse.persistence.internal.jpa.parsing.LogicalOperatorNode
-
- org.eclipse.persistence.internal.jpa.parsing.DotNode
-
- All Implemented Interfaces:
AliasableNode
public class DotNode extends LogicalOperatorNode implements AliasableNode
INTERNALPurpose: This node represents an 'DOT' (i.e. '.') on the input stream. The left and right will depend on the input stream.
Responsibilities:
- 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 DotNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context)INTERNAL Apply this node to the passed querybooleanendsWithCollectionField(GenerationContext context)INTERNAL (): Answer true if the node has a left and right, and the right represents a collection mapping.booleanendsWithDirectToField(GenerationContext context)INTERNAL (): Answer true if the SELECTed node has a left and right, and the right represents a direct-to-field mapping.ExpressiongenerateExpression(GenerationContext context)INTERNAL Return a TopLink expression by getting the required variables using the left and right nodes "emp.address.city" = builder.get("address").get("city")java.lang.StringgetAsString()INTERNAL Get the string representation of this node.NodegetLeftMostNode()INTERNAL Return the left most node of a dot expr, so return 'a' for 'a.b.c'.NodegetRightMostNode()INTERNAL Return the right most node of a dot expr, so return 'c' for 'a.b.c'.java.lang.ObjectgetTypeForMapKey(ParseTreeContext context)java.lang.ClassgetTypeOfDirectToField(GenerationContext context)INTERNAL Returns the attribute type if the right represents a direct-to-field mapping.booleanisAliasableNode()booleanisDotNode()INTERNAL Yes, this is a dot nodeNodequalifyAttributeAccess(ParseTreeContext context)INTERNAL Check the left child node for an unqualified field access.java.lang.StringresolveAttribute()INTERNAL Answer the name of the attribute which is represented by the receiver's right node.java.lang.ClassresolveClass(GenerationContext context)resolveClass: Answer the class which results from traversing the mappings for the receiver's nodesDatabaseMappingresolveMapping(GenerationContext context)INTERNAL Answer the mapping resulting from traversing the receiver's nodesvoidvalidate(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, isEscape, isLiteralNode, isMapKeyNode, isMinusNode, isMultiplyNode, isNotNode, isParameterNode, isPlusNode, isSubqueryNode, isVariableNode, resolveClass, resolveMapping, setAlias, setColumn, setLeft, setLine, setRight, setType, toString, 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
-
applyToQuery
public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context)
INTERNAL Apply this node to the passed query- Overrides:
applyToQueryin classNode
-
qualifyAttributeAccess
public Node qualifyAttributeAccess(ParseTreeContext context)
INTERNAL Check the left child node for an unqualified field access. The method delegates to the left most expression of multi-navigation path expression.- Overrides:
qualifyAttributeAccessin classNode
-
validate
public void validate(ParseTreeContext context)
INTERNAL Validate node and calculate its type. Check for enum literals.- Overrides:
validatein classLogicalOperatorNode
-
generateExpression
public Expression generateExpression(GenerationContext context)
INTERNAL Return a TopLink expression by getting the required variables using the left and right nodes "emp.address.city" = builder.get("address").get("city")- Overrides:
generateExpressionin classNode
-
isDotNode
public boolean isDotNode()
INTERNAL Yes, this is a dot node
-
endsWithDirectToField
public boolean endsWithDirectToField(GenerationContext context)
INTERNAL (): Answer true if the SELECTed node has a left and right, and the right represents a direct-to-field mapping.
-
getTypeOfDirectToField
public java.lang.Class getTypeOfDirectToField(GenerationContext context)
INTERNAL Returns the attribute type if the right represents a direct-to-field mapping.
-
getTypeForMapKey
public java.lang.Object getTypeForMapKey(ParseTreeContext context)
-
endsWithCollectionField
public boolean endsWithCollectionField(GenerationContext context)
INTERNAL (): Answer true if the node has a left and right, and the right represents a collection mapping.
-
resolveAttribute
public java.lang.String resolveAttribute()
INTERNAL Answer the name of the attribute which is represented by the receiver's right node.- Overrides:
resolveAttributein classNode
-
resolveMapping
public DatabaseMapping resolveMapping(GenerationContext context)
INTERNAL Answer the mapping resulting from traversing the receiver's nodes- Overrides:
resolveMappingin classNode
-
resolveClass
public java.lang.Class resolveClass(GenerationContext context)
resolveClass: Answer the class which results from traversing the mappings for the receiver's nodes- Overrides:
resolveClassin classNode
-
getAsString
public java.lang.String getAsString()
INTERNAL Get the string representation of this node.- Overrides:
getAsStringin classNode
-
getLeftMostNode
public Node getLeftMostNode()
INTERNAL Return the left most node of a dot expr, so return 'a' for 'a.b.c'.
-
getRightMostNode
public Node getRightMostNode()
INTERNAL Return the right most node of a dot expr, so return 'c' for 'a.b.c'.
-
isAliasableNode
public boolean isAliasableNode()
- Overrides:
isAliasableNodein classNode
-
-