Class AttributeNode
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.parsing.Node
-
- org.eclipse.persistence.internal.jpa.parsing.AttributeNode
-
public class AttributeNode extends Node
INTERNALPurpose: Represent a attribute.
Responsibilities:
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.jpa.parsing.Node
alias, left, right, shouldGenerateExpression
-
-
Constructor Summary
Constructors Constructor Description AttributeNode()
Create a new AttributeNodeAttributeNode(String name)
Create a new AttributeNode with the passed name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
addToExpression(Expression parentExpression, GenerationContext context)
INTERNAL Add my expression semantics to the parentExpression.Expression
appendCast(Expression exp, GenerationContext context)
void
checkForQueryKey(Object ownerType, TypeHelper typeHelper)
Object
computeActualType(Object initialType, TypeHelper typeHelper)
String
getAsString()
INTERNAL Get the string representation of this node.String
getAttributeName()
String
getCastClassName()
DatabaseMapping
getMapping()
boolean
isAttributeNode()
INTERNAL Is this node an AttributeNodeboolean
isCollectionAttribute()
boolean
isOuterJoin()
Node
qualifyAttributeAccess(ParseTreeContext context)
INTERNAL If called this AttributeNode represents an unqualified field access.boolean
requiresCollectionAttribute()
Class
resolveClass(GenerationContext context, Class ownerClass)
resolveClass: Answer the class for the mapping associated with the my variableName in the ownerClass.DatabaseMapping
resolveMapping(GenerationContext context, Class ownerClass)
resolveMapping: Answer the mapping which corresponds to my variableName.void
setAttributeName(String name)
void
setCastClassName(String castClassName)
void
setMapping(DatabaseMapping mapping)
void
setOuterJoin(boolean outerJoin)
void
setRequiresCollectionAttribute(boolean requiresCollectionAttribute)
String
toString(int indent)
void
validate(ParseTreeContext context)
INTERNAL Validate the current node and calculates its type.-
Methods inherited from class org.eclipse.persistence.internal.jpa.parsing.Node
appendExpression, applyToQuery, generateExpression, getAlias, getColumn, getLeft, getLine, getRight, getType, hasLeft, hasRight, isAggregateNode, isAliasableNode, isConstructorNode, isCountNode, isDivideNode, isDotNode, isEscape, isLiteralNode, isMapKeyNode, isMinusNode, isMultiplyNode, isNotNode, isParameterNode, isPlusNode, isSubqueryNode, isVariableNode, resolveAttribute, resolveClass, resolveMapping, setAlias, setColumn, setLeft, setLine, setRight, setType, toString, toStringDisplayName, toStringIndent, validateParameter
-
-
-
-
Constructor Detail
-
AttributeNode
public AttributeNode()
Create a new AttributeNode
-
AttributeNode
public AttributeNode(String name)
Create a new AttributeNode with the passed name- Parameters:
name
- the attribute name
-
-
Method Detail
-
qualifyAttributeAccess
public Node qualifyAttributeAccess(ParseTreeContext context)
INTERNAL If called this AttributeNode represents an unqualified field access. The method returns a DotNode representing a qualified field access with the base variable as left child node and the attribute as right child node.- Overrides:
qualifyAttributeAccess
in classNode
-
validate
public void validate(ParseTreeContext context)
INTERNAL Validate the current node and calculates its type.
-
appendCast
public Expression appendCast(Expression exp, GenerationContext context)
-
computeActualType
public Object computeActualType(Object initialType, TypeHelper typeHelper)
-
checkForQueryKey
public void checkForQueryKey(Object ownerType, TypeHelper typeHelper)
-
addToExpression
public Expression addToExpression(Expression parentExpression, GenerationContext context)
Description copied from class:Node
INTERNAL Add my expression semantics to the parentExpression. Each subclass will add a different expression and thus will need to override this method- Overrides:
addToExpression
in classNode
-
isAttributeNode
public boolean isAttributeNode()
INTERNAL Is this node an AttributeNode- Overrides:
isAttributeNode
in classNode
-
getAttributeName
public String getAttributeName()
-
setAttributeName
public void setAttributeName(String name)
-
getCastClassName
public String getCastClassName()
-
setCastClassName
public void setCastClassName(String castClassName)
-
isOuterJoin
public boolean isOuterJoin()
-
setOuterJoin
public void setOuterJoin(boolean outerJoin)
-
requiresCollectionAttribute
public boolean requiresCollectionAttribute()
-
setRequiresCollectionAttribute
public void setRequiresCollectionAttribute(boolean requiresCollectionAttribute)
-
getMapping
public DatabaseMapping getMapping()
-
setMapping
public void setMapping(DatabaseMapping mapping)
-
isCollectionAttribute
public boolean isCollectionAttribute()
-
resolveMapping
public DatabaseMapping resolveMapping(GenerationContext context, Class ownerClass)
resolveMapping: Answer the mapping which corresponds to my variableName.- Overrides:
resolveMapping
in classNode
-
resolveClass
public Class resolveClass(GenerationContext context, Class ownerClass)
resolveClass: Answer the class for the mapping associated with the my variableName in the ownerClass. Answer null if the node represents a mapping that doesn't exist- Overrides:
resolveClass
in classNode
-
getAsString
public String getAsString()
INTERNAL Get the string representation of this node.- Overrides:
getAsString
in classNode
-
-