You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is an element a containing the element b and a is deleted, both a and b get deleted because b is contained by a. However, the EMF notification system does not generate any notifications for deleted objects (nor created). As a result, we generate the delete changes ourselves when finishing change recording in the ChangeRecorder.
With #48 we added support for generating delete changes for cascade deleted elements. However, this is not complete as any deletion is preceded by removing the deleted element from its container.
This becomes a problem when applying changes backwards. For a cascade deleted element, it is created when applying the delete change backwards but never inserted into its container as that particular change (i.e. some RemoveEReference / ReplaceSingleValuedEReference) is missing.
Expected result
Recording deletion of a containing b yields change sequence: DeleteEObject(b), RemoveFromContainment(b), DeleteEObject(a) where RemoveFromContainment(_) has to be the appropriate change type depending on the feature that b is contained by (single-/multi-value).
Actual result
Recording deletion of a contains b yield change sequence: DeleteEObject(b), DeleteEObject(a).
Misc
The container and contained in feature of an element are accessible through EObject::eContainer() and EObject::eContainingFeature
The problem currently never appears as we apply changes only backwards when generating hierarchical IDs. As we cache deleted elements there instead of creating new ones (what would be the proper way) the problem does not occur.
The text was updated successfully, but these errors were encountered:
createDeleteChanges (formerly createDeleteChange) creates, for each
deleted object that has a container, a
1. RemoveReferenceChange, if this containment relationship is
many(=multi)-valued,
2. ReplaceSingleReferenceChange, if the containment only allows one
contained object at at time.
If there is an element
a
containing the elementb
anda
is deleted, botha
andb
get deleted becauseb
is contained bya
. However, the EMF notification system does not generate any notifications for deleted objects (nor created). As a result, we generate the delete changes ourselves when finishing change recording in theChangeRecorder
.With #48 we added support for generating delete changes for cascade deleted elements. However, this is not complete as any deletion is preceded by removing the deleted element from its container.
This becomes a problem when applying changes backwards. For a cascade deleted element, it is created when applying the delete change backwards but never inserted into its container as that particular change (i.e. some
RemoveEReference
/ReplaceSingleValuedEReference
) is missing.Expected result
Recording deletion of
a
containingb
yields change sequence:DeleteEObject(b), RemoveFromContainment(b), DeleteEObject(a)
whereRemoveFromContainment(_)
has to be the appropriate change type depending on the feature thatb
is contained by (single-/multi-value).Actual result
Recording deletion of
a
containsb
yield change sequence:DeleteEObject(b), DeleteEObject(a)
.Misc
EObject::eContainer()
andEObject::eContainingFeature
The text was updated successfully, but these errors were encountered: