FileDocCategorySizeDatePackage
CorrelatedInSelectPlan.javaAPI DocGlassfish v2 API3686Fri May 04 22:35:14 BST 2007com.sun.jdo.spi.persistence.support.sqlstore.sql.generator

CorrelatedInSelectPlan

public class CorrelatedInSelectPlan extends CorrelatedSelectPlan
Implements the select plan for In-Subqueries.
author
Markus Fuchs
author
Mitesh Meswani

Fields Summary
Constructors Summary
public CorrelatedInSelectPlan(com.sun.jdo.spi.persistence.support.sqlstore.RetrieveDesc desc, com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager store, com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc parentField, SelectQueryPlan parentPlan)


        super(desc, store, parentField, parentPlan);
    
Methods Summary
protected voiddoCorrelatedJoin()
No-Op. No join condition is added for correlated in selects, as the queries are joined on the selected fields.

protected voidprocessFields()
Add the fields joining the subquery to the list of selected fields. The joined table is added as a side-effect.

        List subqueryFieldsToSelect;

        if (parentField.useJoinTable()) {
            subqueryFieldsToSelect = parentField.getAssocLocalFields();
        } else {
            subqueryFieldsToSelect = parentField.getForeignFields();
        }

        // Add the columns and tables to be selected in the subquery
        for (int i = 0; i < subqueryFieldsToSelect.size(); i++) {
            addColumn((LocalFieldDesc) subqueryFieldsToSelect.get(i));
        }