Skip to content

Cascade Delete

A number of delete API operations support a boolean cascadedDelete option. This adds extra checks and functionality to delete requests.

The default value is false which means that the element can not be deleted if certain dependent elements are still attached. These elements are not typically anchored to this element but have an important relationship.

If cascadedDelete is true, the element can be deleted irrespective of its related elements. It may also delete some of these related elements along with its anchored elements.

The table below shows the specific behaviour for each affected open metadata type. Notice that setting cascadeDelete=true is a powerful option that can delete a lot of metadata - so use with care ...

Type Name cascadeDelete=false cascadeDelete=true
Comment The delete will fail if a comment has child comments linked via the AttachedComment relationship. The comment will be deleted along with the child comments linked via the AttachedComment relationship.
Collection The delete will fail if a collection has member elements linked via the CollectionMembership relationship. The collection will be deleted along with the member elements linked via the CollectionMembership relationship.
DataStructure The delete will fail if a data structure has member data fields linked via the MemberDataField relationship. The data structure will be deleted along with the member data fields linked via the MemberDataField relationship.
DataField The delete will fail if a data field has nested data fields linked at end 2 via the NestedDataField relationship. The data field will be deleted along with the nested data fields linked via the NestedDataField relationship.
DataValueSpecification The delete will fail if the data class/grain is attached to other data class/grain at end 2 via the DataValueHierarchy or DataClassComposition relationships. The data class/grain will be deleted along with the other data classes/grains linked at end 2 via the DataValueHierarchy and DataClassComposition relationships.
Asset The delete will fail if the asset is attached to other data sets at end 2 the DataSetContent relationship. Processing determined by asset's specific type.
ITInfrastructure The delete will fail if an IT infrastructure asset has assets linked at end 1 via the DeployedOn relationship. The IT infrastructure asset will be deleted along with the assets linked via the DeployedOn relationship.
Database The delete will fail if the database is attached to other deployed database schemas via the DataSetContent relationship. The database will be deleted along with the deployed database schemas linked via the DataSetContent relationship.
FileFolder The delete will fail if the folder is attached to either folders or files via the FolderHierarchy or NestedFile relationships, respectively. The folder will be deleted along with the folders and files linked via the FolderHierarchy and NestedFile relationships, respectively.
Implementation details

The rules for cascaded deletes are coded in the generic handlers. Specifically in method validateCascadedDelete in class OpenMetadataAPIGenericHandler. This means that the same delete logic runs regardless of the API call used to request the delete operation.


Raise an issue or comment below