CorrelatedSelectPlanpublic abstract class CorrelatedSelectPlan extends SelectQueryPlan Implements the select plan for correlated subqueries. |
Fields Summary |
---|
protected SelectQueryPlan | parentPlanThe parent plan for this subquery |
Methods Summary |
---|
protected void | addQueryTables(java.util.ArrayList columnList, com.sun.jdo.spi.persistence.support.sqlstore.model.ClassDesc config)Adds the query tables corresponding to the columns in columnList .
for (int i = 0; i < columnList.size(); i++) {
ColumnElement col = (ColumnElement) columnList.get(i);
addQueryTable(col.getDeclaringTable(), config);
}
| protected abstract void | doCorrelatedJoin()Must be implemented by the sub classes.
| protected void | processConstraints()The constraints for correlated subqueries are added here.
The constraints are:
- The correlated constraint joining this subquery with the parent plan
- A join constraint if the parent field uses join table
// Process the constraint on the stack.`
super.processConstraints();
doCorrelatedJoin();
processJoinTable();
// Process any extra statement added as the result of #addTable.
processStatements();
| private void | processJoinTable()Enhance the select statement to include the join table if the
relationship is mapped via a join table.
if (parentField.useJoinTable()) {
addQueryTables(parentField.assocForeignColumns, config);
// Put in a join for the association table.
// Subqueries always join via equijoin.
addJoinConstraint(this, this,
parentField.assocForeignColumns,
parentField.foreignColumns, ActionDesc.OP_EQUIJOIN);
}
|
|