ATLAS-1901: Tolerate no propogatetags on Relationshipdef Signed-off-by: Madhan Neethiraj <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/cda7f56d Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/cda7f56d Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/cda7f56d Branch: refs/heads/feature-odf Commit: cda7f56d5a71970c21de4e2c49771dc85c4a47f0 Parents: 24a106b Author: David Radley <[email protected]> Authored: Wed Jul 19 14:59:30 2017 +0100 Committer: Madhan Neethiraj <[email protected]> Committed: Wed Jul 19 09:39:51 2017 -0700 ---------------------------------------------------------------------- .../store/graph/v1/AtlasRelationshipDefStoreV1.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/cda7f56d/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java index ddf0af9..bdde58b 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java @@ -480,7 +480,12 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme vertex.setProperty(Constants.RELATIONSHIPTYPE_END2_KEY, AtlasType.toJson(relationshipDef.getEndDef2())); // Update RelationshipCategory vertex.setProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, relationshipDef.getRelationshipCategory().name()); - vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, relationshipDef.getPropagateTags().name()); + + if (relationshipDef.getPropagateTags() == null) { + vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, AtlasRelationshipDef.PropagateTags.NONE.name()); + } else { + vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, relationshipDef.getPropagateTags().name()); + } } private AtlasRelationshipDef toRelationshipDef(AtlasVertex vertex) throws AtlasBaseException {
