// ( select t1.fld1, t1.fld2, t2.fld3,...where ....)"
StringBuffer c = new StringBuffer();
if (stack.size() < 2) {
throw new JDOFatalInternalException(I18NHelper.getMessage(messages,
"core.constraint.stackempty")); // NOI18N
}
//Append the first bracket "(" to the result
result.append("("); // NOI18N
if (!(stack.get(stack.size() - 1) instanceof ConstraintField)) {
throw new JDOFatalInternalException(I18NHelper.getMessage(messages,
"core.constraint.needfieldnode")); // NOI18N
} else {
//append "t0.field1" to c
c.append(getWhereText(stack));
}
//Append ", t0.field2, t0fld3,...."
while (stack.size() > 1 && (stack.get(stack.size() - 1) instanceof ConstraintField)) {
c.replace(0, 0, ", "); // NOI18N
c.replace(0, 0, getWhereText(stack));
}
result.append(c.toString());
result.append(") "); // NOI18N
if (opCode == ActionDesc.OP_NOTIN) {
result.append("not "); // NOI18N
}
result.append("in ("); // NOI18N
ConstraintNode currentNode = (ConstraintNode)stack.remove(stack.size() - 1);
if ( ! ( currentNode instanceof ConstraintSubquery)) {
throw new JDOFatalInternalException(I18NHelper.getMessage(messages,
"core.generic.notinstanceof", // NOI18N
currentNode.getClass().getName(), "ConstraintSubquery")); // NOI18N
} else {
ConstraintSubquery sqnode = (ConstraintSubquery) currentNode;