Commit f070d924 by kirankumar D G Committed by Madhan Neethiraj

ATLAS-3084: setting default value to the relationship attributes

parent 39b059e0
......@@ -427,6 +427,16 @@ public class AtlasRelationshipStoreV2 implements AtlasRelationshipStore {
if (relationship.hasAttribute(attrName)) {
AtlasGraphUtilsV2.setEncodedProperty(relationshipEdge, attrVertexProperty, relationship.getAttribute(attrName));
} else {
String defaultValue = attr.getAttributeDef().getDefaultValue();
if (StringUtils.isNotEmpty(defaultValue)) {
Object attrValue = attr.getAttributeType().createDefaultValue(defaultValue);
if (attrValue != null) {
AtlasGraphUtilsV2.setEncodedProperty(relationshipEdge, attrVertexProperty, attrValue);
}
}
}
}
}
......@@ -880,4 +890,4 @@ public class AtlasRelationshipStoreV2 implements AtlasRelationshipStore {
entityChangeNotifier.notifyRelationshipMutation(ret, relationshipUpdate);
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment