Skip to content

Commit

Permalink
Merge pull request #3945 from atlanhq/fixEntityMultation
Browse files Browse the repository at this point in the history
allow updates in entity when relionships are updated
  • Loading branch information
aarshi0301 authored Jan 8, 2025
2 parents f4aa357 + 45d00a3 commit b8edf7a
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,27 +469,26 @@ public EntityMutationResponse mapAttributesAndClassifications(EntityMutationCont
throw baseException;
}
}
} else {

if (CollectionUtils.isNotEmpty(appendEntities)) {
for (AtlasEntity entity : appendEntities) {
String guid = entity.getGuid();
AtlasVertex vertex = context.getVertex(guid);
AtlasEntityType entityType = context.getType(guid);
mapAppendRemoveRelationshipAttributes(entity, entityType, vertex, UPDATE, context, true, false);
}
}
if (CollectionUtils.isNotEmpty(appendEntities)) {
for (AtlasEntity entity : appendEntities) {
String guid = entity.getGuid();
AtlasVertex vertex = context.getVertex(guid);
AtlasEntityType entityType = context.getType(guid);
mapAppendRemoveRelationshipAttributes(entity, entityType, vertex, UPDATE, context, true, false);
}
}

if (CollectionUtils.isNotEmpty(removeEntities)) {
for (AtlasEntity entity : removeEntities) {
String guid = entity.getGuid();
AtlasVertex vertex = context.getVertex(guid);
AtlasEntityType entityType = context.getType(guid);
mapAppendRemoveRelationshipAttributes(entity, entityType, vertex, UPDATE, context, false, true);
}
if (CollectionUtils.isNotEmpty(removeEntities)) {
for (AtlasEntity entity : removeEntities) {
String guid = entity.getGuid();
AtlasVertex vertex = context.getVertex(guid);
AtlasEntityType entityType = context.getType(guid);
mapAppendRemoveRelationshipAttributes(entity, entityType, vertex, UPDATE, context, false, true);
}
}


if (CollectionUtils.isNotEmpty(context.getEntitiesToDelete())) {
deleteDelegate.getHandler().deleteEntities(context.getEntitiesToDelete());
}
Expand All @@ -516,7 +515,6 @@ public EntityMutationResponse mapAttributesAndClassifications(EntityMutationCont

return resp;
}

private void setSystemAttributesToEntity(AtlasVertex entityVertex, AtlasEntity createdEntity) {

createdEntity.setCreatedBy(GraphHelper.getCreatedByAsString(entityVertex));
Expand Down

0 comments on commit b8edf7a

Please sign in to comment.