-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
This could be either classified as a bug or a missing feature:
Given the following Relationships:
One "Person" has Many "Friends".
One "Person" has Many "Kids".
One "Kid" has one "Godparent" - "Godparent" being a foreign key relationship to a row in the "Friends" table.
If a "Person" is getting cloned including its relationships, the "Friends" who are also "Godparents" in of a "Kid" will be duplicated in the "Friends" table.
Solution:
- Save every copied entity in a dictionary, having the original ID and type as key.
- Whenever a related entity is being set in the graph, check if the dictionary contains an instance with the original key.
- If it does not, reset the instance and add it to the dictionary.
- Set the relationship using the instance from the dictionary.
Those steps make sure, that all relationships are using the same instance of entities with a specific key.
Metadata
Metadata
Assignees
Labels
No labels