Methods Summary |
---|
public void | addUpdatesToQuery(oracle.toplink.essentials.queryframework.UpdateAllQuery theQuery, oracle.toplink.essentials.internal.parsing.GenerationContext context)Iterate through the updates in this query and build expressions for them. Set the
built expressions on the query.
Iterator iterator = assignmentNodes.iterator();
while (iterator.hasNext()) {
EqualsAssignmentNode node = (EqualsAssignmentNode)iterator.next();
Expression leftExpression = getExpressionForNode(node.getLeft(), theQuery.getReferenceClass(), context);
Expression rightExpression = getExpressionForNode(node.getRight(), theQuery.getReferenceClass(), context);
theQuery.addUpdate(leftExpression, rightExpression);
}
|
protected oracle.toplink.essentials.expressions.Expression | getExpressionForNode(oracle.toplink.essentials.internal.parsing.Node node, java.lang.Class referenceClass, oracle.toplink.essentials.internal.parsing.GenerationContext context)Create an expression to represent one of the nodes on a SetToNode.
We will assume that set_to nodes change elements that are direct mappings on the reference
class of the query.
Expression expression = null;
if (node.isAttributeNode()) {
// look up a preexisting expression based on the reference class of the query.
String classVariable = context.getParseTreeContext().getVariableNameForClass(referenceClass, context);
expression = context.expressionFor(classVariable);
if (expression == null) {
expression = new ExpressionBuilder();
context.addExpression(expression, classVariable);
}
expression = node.addToExpression(expression, context);
} else {
expression = node.generateExpression(context);
}
return expression;
|
public oracle.toplink.essentials.internal.parsing.Node | qualifyAttributeAccess(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)INTERNAL
Check the update item node for a path expression starting with a
unqualified field access and if so, replace it by a qualified field
access.
for (Iterator i = assignmentNodes.iterator(); i.hasNext(); ) {
Node item = (Node)i.next();
item.qualifyAttributeAccess(context);
}
return this;
|
public void | setAssignmentNodes(java.util.List nodes)INTERNAL
assignmentNodes = nodes;
|
public void | validate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)INTERNAL
Validate node.
for (Iterator i = assignmentNodes.iterator(); i.hasNext(); ) {
Node item = (Node)i.next();
item.validate(context);
}
|