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(java.lang.String name)Create a new AttributeNode with the passed name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExpressionaddToExpression(Expression parentExpression, GenerationContext context)INTERNAL Add my expression semantics to the parentExpression.ExpressionappendCast(Expression exp, GenerationContext context)voidcheckForQueryKey(java.lang.Object ownerType, TypeHelper typeHelper)java.lang.ObjectcomputeActualType(java.lang.Object initialType, TypeHelper typeHelper)java.lang.StringgetAsString()INTERNAL Get the string representation of this node.java.lang.StringgetAttributeName()java.lang.StringgetCastClassName()DatabaseMappinggetMapping()booleanisAttributeNode()INTERNAL Is this node an AttributeNodebooleanisCollectionAttribute()booleanisOuterJoin()NodequalifyAttributeAccess(ParseTreeContext context)INTERNAL If called this AttributeNode represents an unqualified field access.booleanrequiresCollectionAttribute()java.lang.ClassresolveClass(GenerationContext context, java.lang.Class ownerClass)resolveClass: Answer the class for the mapping associated with the my variableName in the ownerClass.DatabaseMappingresolveMapping(GenerationContext context, java.lang.Class ownerClass)resolveMapping: Answer the mapping which corresponds to my variableName.voidsetAttributeName(java.lang.String name)voidsetCastClassName(java.lang.String castClassName)voidsetMapping(DatabaseMapping mapping)voidsetOuterJoin(boolean outerJoin)voidsetRequiresCollectionAttribute(boolean requiresCollectionAttribute)java.lang.StringtoString(int indent)voidvalidate(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
-
-
-
-
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:
qualifyAttributeAccessin 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 java.lang.Object computeActualType(java.lang.Object initialType, TypeHelper typeHelper)
-
checkForQueryKey
public void checkForQueryKey(java.lang.Object ownerType, TypeHelper typeHelper)
-
addToExpression
public Expression addToExpression(Expression parentExpression, GenerationContext context)
Description copied from class:NodeINTERNAL Add my expression semantics to the parentExpression. Each subclass will add a different expression and thus will need to override this method- Overrides:
addToExpressionin classNode
-
isAttributeNode
public boolean isAttributeNode()
INTERNAL Is this node an AttributeNode- Overrides:
isAttributeNodein classNode
-
getAttributeName
public java.lang.String getAttributeName()
-
setAttributeName
public void setAttributeName(java.lang.String name)
-
getCastClassName
public java.lang.String getCastClassName()
-
setCastClassName
public void setCastClassName(java.lang.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, java.lang.Class ownerClass)
resolveMapping: Answer the mapping which corresponds to my variableName.- Overrides:
resolveMappingin classNode
-
resolveClass
public java.lang.Class resolveClass(GenerationContext context, java.lang.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:
resolveClassin classNode
-
getAsString
public java.lang.String getAsString()
INTERNAL Get the string representation of this node.- Overrides:
getAsStringin classNode
-
-