From 09adb515307ad9d4d2b40f27dcd8012fee60e40c Mon Sep 17 00:00:00 2001 From: PRATHAM2002-DS Date: Wed, 20 Nov 2024 17:53:39 +0530 Subject: [PATCH] mesh-283: unlink domain from asset to delete --- .../graph/v2/preprocessor/AssetPreProcessor.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/AssetPreProcessor.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/AssetPreProcessor.java index 791b19fca8..b500ba3847 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/AssetPreProcessor.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/preprocessor/AssetPreProcessor.java @@ -61,6 +61,9 @@ public void processAttributes(AtlasStruct entityStruct, EntityMutationContext co case UPDATE: processUpdateAsset(entity, vertex); break; + case DELETE: + processDelete(vertex); + break; } } @@ -116,6 +119,14 @@ private void validateDomainAssetLinks(AtlasEntity entity) throws AtlasBaseExcept } } + @Override + public void processDelete(AtlasVertex vertex) throws AtlasBaseException { + //remove the domain link + if (vertex != null) { + vertex.removeProperty(DOMAIN_GUIDS); + } + } + private void isAuthorized(AtlasVertex vertex) throws AtlasBaseException { AtlasEntityHeader sourceEntity = retrieverNoRelation.toAtlasEntityHeaderWithClassifications(vertex);