if (field.getIndependentTypeMappings().length != 1)
throw RelationStrategies.uninversable(field);
// get the row for the inverse object; the row might be in a secondary
// table if there is a field controlling the foreign key
Row row = null;
FieldMapping[] invs = field.getInverseMappings();
for (int i = 0; i < invs.length; i++) {
if (invs[i].getMappedByMetaData() == field
&& invs[i].getTypeCode() == JavaTypes.PC) {
row = invs[i].getRow(rel, store, rm, action);
break;
}
}
ClassMapping relMapping = field.getTypeMapping();
if (row == null)
row = rm.getRow(relMapping.getTable(), action, rel, true);
// if this is an update, this might be the only mod to the row, so
// make sure the where condition is set
if (action == Row.ACTION_UPDATE
&& row.getTable() == relMapping.getTable())
row.wherePrimaryKey(rel);
// update the inverse pointer with our oid value
row.setForeignKey(fk, io, sm);
}