EqualsAssignmentNodepublic class EqualsAssignmentNode extends BinaryOperatorNode INTERNAL:
EqualsAssignmentNode is implemented to distinguish nodes that hold updates in an update
query from other BinaryOperatorNodes |
Methods Summary |
---|
public void | validate(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 void | validateNavigation(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 void | validateTarget(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);
}
}
|
|