use of com.sun.jdo.spi.persistence.support.sqlstore.sql.constraint.ConstraintFieldDesc in project Payara by payara.
the class CorrelatedExistSelectPlan method doCorrelatedJoin.
/**
* The correlated constraint joining this subquery with the parent field.
* The joined table is added as a side-effect.
*/
protected void doCorrelatedJoin() {
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);
}
}
Aggregations