FileDocCategorySizeDatePackage
EqualsAssignmentNode.javaAPI DocGlassfish v2 API4211Tue May 22 16:54:38 BST 2007oracle.toplink.essentials.internal.parsing

EqualsAssignmentNode

public class EqualsAssignmentNode extends BinaryOperatorNode
INTERNAL: EqualsAssignmentNode is implemented to distinguish nodes that hold updates in an update query from other BinaryOperatorNodes

Fields Summary
Constructors Summary
Methods Summary
public voidvalidate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Validate the current node and calculates its type.

        // look for any field access that is not qualified with an variable
        super.validate(context);
        validateTarget(left, context);
    
private voidvalidateNavigation(oracle.toplink.essentials.internal.parsing.Node qualifier, oracle.toplink.essentials.internal.parsing.ParseTreeContext context)

        if (qualifier.isDotNode()) {
            TypeHelper typeHelper = context.getTypeHelper();
            Node left = qualifier.getLeft();
            AttributeNode attributeNode = (AttributeNode)qualifier.getRight();
            String attribute = attributeNode.getAttributeName();
            Object type = left.getType();
            if (!typeHelper.isEmbeddedAttribute(type, attribute)) {
                throw EJBQLException.invalidSetClauseNavigation(
                    context.getQueryInfo(), attributeNode.getLine(), 
                    attributeNode.getColumn(), qualifier.getAsString(), attribute);
            }
            validateNavigation(left, context);
        }
    
private voidvalidateTarget(oracle.toplink.essentials.internal.parsing.Node node, oracle.toplink.essentials.internal.parsing.ParseTreeContext context)

        if (node.isDotNode()) {
            TypeHelper typeHelper = context.getTypeHelper();
            Node path = node.getLeft();
            Object type = path.getType();
            AttributeNode attributeNode = (AttributeNode)node.getRight();
            String attribute = attributeNode.getAttributeName();
            if (typeHelper.isSingleValuedRelationship(type, attribute) || 
                typeHelper.isSimpleStateAttribute(type, attribute)) {
                validateNavigation(path, context);
            } else {
                throw EJBQLException.invalidSetClauseTarget(
                    context.getQueryInfo(), attributeNode.getLine(), 
                    attributeNode.getColumn(), path.getAsString(), attribute);
            }
        }