Methods Summary |
---|
public oracle.toplink.essentials.expressions.Expression | generateExpression(oracle.toplink.essentials.internal.parsing.GenerationContext context)
// Need to make sure one of the node is marked as a one to many
if (getRight().isParameterNode()) {
makeNodeOneToMany(getLeft());
} else {
makeNodeOneToMany(getRight());
}
//Handle NOT. Store the expression for the left, let VariableNode handle it.
if (notIndicated()) {
Expression resultFromRight = null;
context.setMemberOfNode(this);
this.setLeftExpression(getLeft().generateExpression(context));
resultFromRight = getRight().generateExpression(context);
//clean up
context.setMemberOfNode(null);
this.setLeftExpression(null);
return resultFromRight;
} else {
//otherwise, handle like normal anyOf()
return getRight().generateExpression(context).equal(getLeft().generateExpression(context));
}
|
public oracle.toplink.essentials.expressions.Expression | getLeftExpression()
return leftExpression;
|
public void | indicateNot()INTERNAL
Indicate if a NOT was found in the WHERE clause.
Examples:
...WHERE ... NOT MEMBER OF
notIndicated = true;
|
public void | makeNodeOneToMany(oracle.toplink.essentials.internal.parsing.Node theNode)INTERNAL makeNodeOneToMany:
Traverse to the leaf on theNode and mark as one to many
Node currentNode = theNode;
do {
if (!currentNode.hasRight()) {
((AttributeNode)currentNode).setRequiresCollectionAttribute(true);
return;
}
currentNode = currentNode.getRight();
} while (true);
|
public boolean | notIndicated()
return notIndicated;
|
public void | setLeftExpression(oracle.toplink.essentials.expressions.Expression newLeftExpression)
leftExpression = newLeftExpression;
|
public void | validate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)INTERNAL
Validate node and calculates its type.
super.validate(context);
Node left = getLeft();
if (left.isVariableNode() && ((VariableNode)left).isAlias(context)) {
context.usedVariable(((VariableNode)left).getCanonicalVariableName());
}
left.validateParameter(context, right.getType());
TypeHelper typeHelper = context.getTypeHelper();
setType(typeHelper.getBooleanType());
|