Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-08-30 06:09:21 -0400
committerEike Stepper2013-08-30 06:09:21 -0400
commit03cfaa273b296b33420bac00d4afdf7f6db7b5de (patch)
tree1ffe7ffc58fde5b9a2d2913ead39e80e2c7b0b6d /plugins
parent538361f240b7c11093e50cfcfbf41b3120b1e7d7 (diff)
downloadcdo-03cfaa273b296b33420bac00d4afdf7f6db7b5de.tar.gz
cdo-03cfaa273b296b33420bac00d4afdf7f6db7b5de.tar.xz
cdo-03cfaa273b296b33420bac00d4afdf7f6db7b5de.zip
[416215] [DB] Enum default values are not correctly determined in
CoreTypeMappings.TMEnum https://bugs.eclipse.org/bugs/show_bug.cgi?id=416215
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java
index 2d2decbd2d..1aa6b4889d 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java
@@ -31,7 +31,10 @@ import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.util.HexUtil;
import org.eclipse.net4j.util.factory.ProductCreationException;
+import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EFactory;
import org.eclipse.emf.ecore.EcorePackage;
@@ -75,7 +78,20 @@ public class CoreTypeMappings
@Override
protected Object getDefaultValue()
{
- return getFeature().getDefaultValue();
+ // return getFeature().getDefaultValue();
+
+ EEnum eenum = (EEnum)getFeature().getEType();
+
+ String defaultValueLiteral = getFeature().getDefaultValueLiteral();
+ if (defaultValueLiteral != null)
+ {
+ EEnumLiteral literal = eenum.getEEnumLiteralByLiteral(defaultValueLiteral);
+ return literal.getValue();
+ }
+
+ Enumerator enumerator = (Enumerator)eenum.getDefaultValue();
+ return enumerator.getValue();
+
}
/**

Back to the top