Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 61e03d407 -> 8f5c26429


ATLAS-2745 - AtlasEnumDefStore should remember default value

Signed-off-by: David Radley <[email protected]>
(cherry picked from commit ce5ffeb710721b78135e8b3c3ebe593bd70d2cdf)
(cherry picked from commit d5ca279bcf3c23d6e0e8e9a9dd2fbca4199f83b7)


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

Branch: refs/heads/branch-0.8
Commit: 8f5c26429f494c670a64cbd3c759ab3dcd02a891
Parents: 61e03d4
Author: Graham Wallis <[email protected]>
Authored: Thu Jun 7 14:25:53 2018 +0100
Committer: Madhan Neethiraj <[email protected]>
Committed: Sun Jun 10 08:38:27 2018 -0700

----------------------------------------------------------------------
 .../atlas/repository/store/graph/v1/AtlasEnumDefStoreV1.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/8f5c2642/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEnumDefStoreV1.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEnumDefStoreV1.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEnumDefStoreV1.java
index 5bd9c12..6b1e1e5 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEnumDefStoreV1.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEnumDefStoreV1.java
@@ -270,6 +270,9 @@ class AtlasEnumDefStoreV1 extends 
AtlasAbstractDefStoreV1<AtlasEnumDef> {
             values.add(element.getValue());
         }
         AtlasGraphUtilsV1.setProperty(vertex, 
AtlasGraphUtilsV1.getTypeDefPropertyKey(enumDef), values);
+
+        String defaultValueKey = 
AtlasGraphUtilsV1.getTypeDefPropertyKey(enumDef, "defaultValue");
+        AtlasGraphUtilsV1.setProperty(vertex, defaultValueKey, 
enumDef.getDefaultValue());
     }
 
     private AtlasEnumDef toEnumDef(AtlasVertex vertex) {
@@ -300,6 +303,10 @@ class AtlasEnumDefStoreV1 extends 
AtlasAbstractDefStoreV1<AtlasEnumDef> {
         }
         ret.setElementDefs(elements);
 
+        String defaultValueKey = AtlasGraphUtilsV1.getTypeDefPropertyKey(ret, 
"defaultValue");
+        String defaultValue = AtlasGraphUtilsV1.getProperty(vertex, 
defaultValueKey, String.class);
+        ret.setDefaultValue(defaultValue);
+
         return ret;
     }
 }

Reply via email to