How does the DeepDelete functionality work in Identity Manager?
There are two DeepDelete's:
1. The SQL procedure SDK_DeepDelete - this deletes the data on the database directly.
2. The function in the ObjectBrowser - this acts over the object layer.
The result should be the same.
The general behavior:
Identity Manager has 3 kinds of relations between tables:
DR - Delete Restrict
DC - Delete Cascade
DS - Delete Set null
DR means if a parent object is deleted, and a child object exists the deletion will not be possible.
DC means that the child object will be deleted too.
DS means that the foreign key in the child (which points to the parent) will be cleared.
Only DR relations could cause a problem when deleting an object.
That's why DeepDelete handles the DC and DS relations as they are defined.
DR relations will be changed to DC or DS.
DC if the foreign key in the child is a mandatory field.
DS if the foreign key is not mandatory.
Of course it works recursively.
That means for every child object which has to be deleted the same functions will be used.
The settings of the relation types can be shown in the Designer in the SchemaEditor.
Or with a statement such as this:
cp.TableName as 'ParentTable',
cp.ColumnName as 'ParentColumn (Primary key)',
cc.TableName as 'ChildTable',
cc.ColumnName as 'ChildColumn (Foreign key)',
from DialogTableRelation tr
join DialogColumnRelation cr on tr.RelationID = cr.RelationID join DialogColumn cp on cr.UID_ParentColumn = cp.UID_DialogColumn join dialogcolumn cc on cr.UID_ChildColumn = cc.UID_DialogColumn where
cp.TableName = 'Person'
order by 1,2,3,4