Iterator it = dbEntity.getDataMap().getMappedEntities(dbEntity).iterator();
if (!it.hasNext()) {
return;
}
EntityMergeSupport merger = new EntitySyncController(Application
.getInstance()
.getFrameController(), dbEntity).createMerger();
if (merger == null) {
return;
}
DbEntitySyncUndoableEdit undoableEdit = new DbEntitySyncUndoableEdit((DataChannelDescriptor)mediator.getProject().getRootNode()
, mediator.getCurrentDataMap());
while (it.hasNext()) {
ObjEntity entity = (ObjEntity) it.next();
DbEntitySyncUndoableEdit.EntitySyncUndoableListener listener = undoableEdit.new EntitySyncUndoableListener(
entity);
merger.addEntityMergeListener(listener);
if (merger.isRemoveMeaningfulFKs()) {
undoableEdit.addEdit(undoableEdit.new MeaningfulFKsUndoableEdit(
entity,
merger.getMeaningfulFKs(entity)));
}
if (merger.synchronizeWithDbEntity(entity)) {
mediator.fireObjEntityEvent(new EntityEvent(
this,
entity,
MapEvent.CHANGE));
}
merger.removeEntityMergeListener(listener);
}
application.getUndoManager().addEdit(undoableEdit);
}
}