Repository: incubator-atlas
Updated Branches:
  refs/heads/master 24a106b4e -> cda7f56d5


ATLAS-1901: Tolerate no propogatetags on Relationshipdef

Signed-off-by: Madhan Neethiraj <mad...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/cda7f56d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/cda7f56d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/cda7f56d

Branch: refs/heads/master
Commit: cda7f56d5a71970c21de4e2c49771dc85c4a47f0
Parents: 24a106b
Author: David Radley <david_rad...@uk.ibm.com>
Authored: Wed Jul 19 14:59:30 2017 +0100
Committer: Madhan Neethiraj <mad...@apache.org>
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/incubator-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 {

Reply via email to