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 void
applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context)
INTERNAL Apply this node to the passed queryboolean
endsWithCollectionField(GenerationContext context)
INTERNAL (): Answer true if the node has a left and right, and the right represents a collection mapping.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.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")String
getAsString()
INTERNAL Get the string representation of this node.Node
getLeftMostNode()
INTERNAL Return the left most node of a dot expr, so return 'a' for 'a.b.c'.Node
getRightMostNode()
INTERNAL Return the right most node of a dot expr, so return 'c' for 'a.b.c'.Object
getTypeForMapKey(ParseTreeContext context)
Class
getTypeOfDirectToField(GenerationContext context)
INTERNAL Returns the attribute type if the right represents a direct-to-field mapping.boolean
isAliasableNode()
boolean
isDotNode()
INTERNAL Yes, this is a dot nodeNode
qualifyAttributeAccess(ParseTreeContext context)
INTERNAL Check the left child node for an unqualified field access.String
resolveAttribute()
INTERNAL Answer the name of the attribute which is represented by the receiver's right node.Class
resolveClass(GenerationContext context)
resolveClass: Answer the class which results from traversing the mappings for the receiver's nodesDatabaseMapping
resolveMapping(GenerationContext context)
INTERNAL Answer the mapping resulting from traversing the receiver's nodesvoid
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, 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:
applyToQuery
in 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:
qualifyAttributeAccess
in classNode
-
validate
public void validate(ParseTreeContext context)
INTERNAL Validate node and calculate its type. Check for enum literals.- Overrides:
validate
in 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:
generateExpression
in 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 Class getTypeOfDirectToField(GenerationContext context)
INTERNAL Returns the attribute type if the right represents a direct-to-field mapping.
-
getTypeForMapKey
public 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 String resolveAttribute()
INTERNAL Answer the name of the attribute which is represented by the receiver's right node.- Overrides:
resolveAttribute
in classNode
-
resolveMapping
public DatabaseMapping resolveMapping(GenerationContext context)
INTERNAL Answer the mapping resulting from traversing the receiver's nodes- Overrides:
resolveMapping
in classNode
-
resolveClass
public Class resolveClass(GenerationContext context)
resolveClass: Answer the class which results from traversing the mappings for the receiver's nodes- Overrides:
resolveClass
in classNode
-
getAsString
public String getAsString()
INTERNAL Get the string representation of this node.- Overrides:
getAsString
in 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:
isAliasableNode
in classNode
-
-