final Model mcopy = m.copy(mcrit);
version = mcopy.getVersion();
mcopy.setVersion(version == null ? 0 : version++);
ArrayList<Model> alist = null;
List<Model> existing;
final RelatedManyProperty ap = mcopy.relatedMany("addresses");
existing = ap.getModelList();
if(existing != null) {
alist = new ArrayList<Model>();
for(final Model am : existing) {
if(!am.isMarkedDeleted()) {
version = am.getVersion();
am.setVersion(version == null ? 0 : version++);
alist.add(am);
}
}
ap.setValue(alist);
}
ep.setModel(mcopy);
mv.setModel(mcopy);
mvchanged.setModel(event.getChangedModel());
m = mcopy;