CorrelatedExistSelectPlanpublic class CorrelatedExistSelectPlan extends CorrelatedSelectPlan Implements the select plan for Exist-Subqueries. |
Methods Summary |
---|
protected void | doCorrelatedJoin()The correlated constraint joining this subquery with the parent field.
The joined table is added as a side-effect.
ArrayList foreignFields = null;
if (parentField.useJoinTable()) {
foreignFields = parentField.assocLocalFields;
// The join table is included in #processJoinTable
} else {
foreignFields = parentField.foreignFields;
}
ArrayList localFields = parentField.localFields;
// Add the constraint linking the parent query with the subquery.
for (int i = 0; i < localFields.size(); i++) {
LocalFieldDesc la = (LocalFieldDesc) localFields.get(i);
LocalFieldDesc fa = (LocalFieldDesc) foreignFields.get(i);
ConstraintFieldDesc lcfd = new ConstraintFieldDesc(la, parentPlan);
ConstraintFieldDesc fcfd = new ConstraintFieldDesc(fa, this);
constraint.addField(lcfd);
constraint.addField(fcfd);
// Subqueries always join via equijoin.
constraint.addOperation(ActionDesc.OP_EQ);
}
| protected Statement | newStatement()
return new SelectOneStatement(store.getVendorType(), this);
| protected void | processFields()There are no real fields to be selected for an (NOT)EXIST query.
This method just adds the table for the nested select.
The statement for nested select is created as a side effect.
for (int i = 0; i < parentField.foreignFields.size(); i++) {
LocalFieldDesc field = (LocalFieldDesc) parentField.foreignFields.get(i);
addTable(field);
}
|
|