Hi,
Is it possible to keep references to related data, when I remove an object via soft-delete?
A customer deleted lots of entries that need to be restored, which is no problem as I just need to set GCRecord to null. But the relations are all lost! Is there a possibility to prevent that?
We have closed this ticket because another page addresses its subject:
Deferred deletion removes referencesXPO Soft-Delete without deleting relations
Answers approved by DevExpress Support
Hello Benjamin,
Please see possible ways to overcome this limitation here: Deferred deletion removes references. Let me know if you need further assistance.
Update:
As described in the How to: Restore Deleted Objects topic, the Deferred Deletion feature is not intended for object restoration, but for overcoming complex foreign index constraints at the database level. I have consulted with our developers, and we see a way to implement the functionality you are requesting through a custom IObjectLayer. See an example on the attachment. Feel free to test it and leave your feedback.
Thank you for your feedback. We will definitely take it into account in the future. Currently, we do not have solutions other than the ones described in the Deferred deletion removes references ticket.
Hi Anatol,
I agree with Benjamin. Seems the current XPO way of handling this leaves orphaned records, which is not good from a data integrity standpoint. I understand it makes it simpler for the purgedeletedrecords logic as it then doesn't need to go in any specific order, but it seems it could figure out the associations by interrogating the persistent objects and work it's way up the hierarchy to delete in the right order and prevent and RI constraint errors.
As described in the How to: Restore Deleted Objects topic, the Deferred Deletion feature is not intended for object restoration, but for overcoming complex foreign index constraints at the database level. I have consulted with our developers, and we see a way to implement the functionality you are requesting through a custom IObjectLayer. See an example on the attachment. Feel free to test it and leave your feedback.