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 { ...@@ -427,6 +427,16 @@ public class AtlasRelationshipStoreV2 implements AtlasRelationshipStore {
if (relationship.hasAttribute(attrName)) { if (relationship.hasAttribute(attrName)) {
AtlasGraphUtilsV2.setEncodedProperty(relationshipEdge, attrVertexProperty, relationship.getAttribute(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);
}
}
} }
} }
} }
......
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