// if our foreign key has a delete action, we need to set the
// related object so constraints can be evaluated
OpenJPAStateManager rel = RelationStrategies.getStateManager
(sm.fetchObjectField(field.getIndex()), store.getContext());
if (rel != null) {
ForeignKey fk = field.getForeignKey((ClassMapping)
rel.getMetaData());
if (fk.getDeleteAction() == ForeignKey.ACTION_RESTRICT ||
fk.getDeleteAction() == ForeignKey.ACTION_CASCADE) {
Row row = field.getRow(sm, store, rm, Row.ACTION_DELETE);
row.setForeignKey(fk, null, rel);
// this is for bi-directional maps, the key and value of the
// map are stored in the table of the mapped-by entity
setMapKey(sm, rel, store, row);