}
}
public void addForeignConstraints(int action, ForeignFieldDesc f, SQLStateManager sm) {
for (int i = 0; i < f.foreignFields.size(); i++) {
LocalFieldDesc ff = (LocalFieldDesc) f.foreignFields.get(i);
if (action == QueryPlan.ACT_INSERT) {
// For inserts into the join table, we get the values we are inserting
// for the parent object and the added object.
ColumnElement fc = (ColumnElement) f.assocForeignColumns.get(i);
addColumn(fc, ff.getValue(sm));
} else if (action == QueryPlan.ACT_DELETE) {
LocalFieldDesc aff = (LocalFieldDesc) f.assocForeignFields.get(i);
// For deletes from the join table, we get the constraint values
// from the parent object and the remove object.
addConstraint(aff, ff.getValue(sm));
}