Methods Summary |
---|
public void | addNodeToTheObjects(oracle.toplink.essentials.internal.parsing.Node theNode)INTERNAL
Add the passed node value to the collection of object for this node
getTheObjects().add(theNode);
|
public oracle.toplink.essentials.expressions.Expression | generateExpression(oracle.toplink.essentials.internal.parsing.GenerationContext context)INTERNAL
Return the TopLink expression for this node
Expression whereClause = getLeft().generateExpression(context);
List arguments = getTheObjects();
Node firstArg = (Node)arguments.get(0);
if (firstArg.isSubqueryNode()) {
SubqueryNode subqueryNode = (SubqueryNode)firstArg;
ReportQuery reportQuery = subqueryNode.getReportQuery(context);
if (notIndicated()) {
whereClause = whereClause.notIn(reportQuery);
}
else {
whereClause = whereClause.in(reportQuery);
}
}
else {
Vector inArguments = new Vector(arguments.size());
for (Iterator iter = arguments.iterator(); iter.hasNext();) {
Node nextNode = (Node)iter.next();
inArguments.add(nextNode.generateExpression(context));
}
if (inArguments.size() > 0) {
if (notIndicated()) {
whereClause = whereClause.notIn(inArguments);
} else {
whereClause = whereClause.in(inArguments);
}
}
}
return whereClause;
|
public java.util.List | getTheObjects()INTERNAL
Return the collection of the objects used as parameters for this node
if (theObjects == null) {
setTheObjects(new Vector());
}
return theObjects;
|
public void | indicateNot()INTERNAL
Indicate if a NOT was found in the WHERE clause.
Examples:
...WHERE ... NOT IN(...)
notIndicated = true;
|
public boolean | notIndicated()
return notIndicated;
|
public void | setTheObjects(java.util.List newTheObjects)INTERNAL
Set this node's object collection to the passed value
theObjects = newTheObjects;
|
public void | validate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)INTERNAL
Validate the current node and calculates its type.
Object leftType = null;
TypeHelper typeHelper = context.getTypeHelper();
if (left != null) {
left.validate(context);
leftType = left.getType();
}
for (Iterator i = getTheObjects().iterator(); i.hasNext();) {
Node node = (Node)i.next();
node.validate(context);
node.validateParameter(context, leftType);
Object nodeType = node.getType();
if ((leftType != null) && !typeHelper.isAssignableFrom(leftType, nodeType))
throw EJBQLException.invalidExpressionArgument(
context.getQueryInfo(), node.getLine(), node.getColumn(),
"IN", node.getAsString(), typeHelper.getTypeName(leftType));
}
setType(typeHelper.getBooleanType());
|