Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2020-06-15 14:37:20 +0000
committerEike Stepper2020-06-15 14:37:20 +0000
commit573ae3e2aba5917ccf1c0d385005f46c41a303ec (patch)
treefd47dd7848b09ecb2afc5a2e62fa30b59112eb4d
parent312603b5a8aaead3e750419c0a16e50f434eefb3 (diff)
downloadcdo-573ae3e2aba5917ccf1c0d385005f46c41a303ec.tar.gz
cdo-573ae3e2aba5917ccf1c0d385005f46c41a303ec.tar.xz
cdo-573ae3e2aba5917ccf1c0d385005f46c41a303ec.zip
[564302] Serialization of non-Lob data types in etypes package is broken
https://bugs.eclipse.org/bugs/show_bug.cgi?id=564302
-rw-r--r--features/org.eclipse.emf.cdo.server.db-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.cdo.server.db-feature/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF68
-rw-r--r--plugins/org.eclipse.emf.cdo.common/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF16
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/CoreTypeMappings.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java81
9 files changed, 95 insertions, 86 deletions
diff --git a/features/org.eclipse.emf.cdo.server.db-feature/feature.xml b/features/org.eclipse.emf.cdo.server.db-feature/feature.xml
index c40223b1e4..13b674cec3 100644
--- a/features/org.eclipse.emf.cdo.server.db-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.server.db-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.emf.cdo.server.db"
label="%featureName"
- version="4.9.0.qualifier"
+ version="4.9.1.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.emf.cdo.license"
license-feature-version="0.0.0">
diff --git a/features/org.eclipse.emf.cdo.server.db-feature/pom.xml b/features/org.eclipse.emf.cdo.server.db-feature/pom.xml
index c8682efcf3..7155657e2d 100644
--- a/features/org.eclipse.emf.cdo.server.db-feature/pom.xml
+++ b/features/org.eclipse.emf.cdo.server.db-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.emf.cdo.server.db</artifactId>
- <version>4.9.0-SNAPSHOT</version>
+ <version>4.9.1-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
index 11e6b3c0e3..da2e9962f7 100644
--- a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.common;singleton:=true
-Bundle-Version: 4.10.0.qualifier
+Bundle-Version: 4.10.1.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -15,21 +15,21 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";visibili
org.eclipse.emf.ecore.change;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.common;version="4.10.0",
- org.eclipse.emf.cdo.common.admin;version="4.10.0",
- org.eclipse.emf.cdo.common.branch;version="4.10.0",
- org.eclipse.emf.cdo.common.commit;version="4.10.0",
- org.eclipse.emf.cdo.common.commit.handler;version="4.10.0",
- org.eclipse.emf.cdo.common.id;version="4.10.0",
- org.eclipse.emf.cdo.common.lob;version="4.10.0",
- org.eclipse.emf.cdo.common.lock;version="4.10.0",
- org.eclipse.emf.cdo.common.model;version="4.10.0",
- org.eclipse.emf.cdo.common.protocol;version="4.10.0",
- org.eclipse.emf.cdo.common.revision;version="4.10.0",
- org.eclipse.emf.cdo.common.revision.delta;version="4.10.0",
- org.eclipse.emf.cdo.common.security;version="4.10.0",
- org.eclipse.emf.cdo.common.util;version="4.10.0",
- org.eclipse.emf.cdo.internal.common;version="4.10.0";
+Export-Package: org.eclipse.emf.cdo.common;version="4.10.1",
+ org.eclipse.emf.cdo.common.admin;version="4.10.1",
+ org.eclipse.emf.cdo.common.branch;version="4.10.1",
+ org.eclipse.emf.cdo.common.commit;version="4.10.1",
+ org.eclipse.emf.cdo.common.commit.handler;version="4.10.1",
+ org.eclipse.emf.cdo.common.id;version="4.10.1",
+ org.eclipse.emf.cdo.common.lob;version="4.10.1",
+ org.eclipse.emf.cdo.common.lock;version="4.10.1",
+ org.eclipse.emf.cdo.common.model;version="4.10.1",
+ org.eclipse.emf.cdo.common.protocol;version="4.10.1",
+ org.eclipse.emf.cdo.common.revision;version="4.10.1",
+ org.eclipse.emf.cdo.common.revision.delta;version="4.10.1",
+ org.eclipse.emf.cdo.common.security;version="4.10.1",
+ org.eclipse.emf.cdo.common.util;version="4.10.1",
+ org.eclipse.emf.cdo.internal.common;version="4.10.1";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -38,10 +38,10 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.10.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.branch;version="4.10.0";
+ org.eclipse.emf.cdo.internal.common.branch;version="4.10.1";
x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.bundle;version="4.10.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.commit;version="4.10.0";
+ org.eclipse.emf.cdo.internal.common.bundle;version="4.10.1";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.commit;version="4.10.1";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -50,7 +50,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.10.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.id;version="4.10.0";
+ org.eclipse.emf.cdo.internal.common.id;version="4.10.1";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -61,9 +61,9 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.10.0",
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.admin,
org.eclipse.emf.cdo.server.admin",
- org.eclipse.emf.cdo.internal.common.lock;version="4.10.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.messages;version="4.10.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.model;version="4.10.0";
+ org.eclipse.emf.cdo.internal.common.lock;version="4.10.1";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.messages;version="4.10.1";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.model;version="4.10.1";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -72,7 +72,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.10.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.revision;version="4.10.0";
+ org.eclipse.emf.cdo.internal.common.revision;version="4.10.1";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -81,7 +81,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.10.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.revision.delta;version="4.10.0";
+ org.eclipse.emf.cdo.internal.common.revision.delta;version="4.10.1";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -90,14 +90,14 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.10.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.spi.common;version="4.10.0",
- org.eclipse.emf.cdo.spi.common.admin;version="4.10.0",
- org.eclipse.emf.cdo.spi.common.branch;version="4.10.0",
- org.eclipse.emf.cdo.spi.common.commit;version="4.10.0",
- org.eclipse.emf.cdo.spi.common.id;version="4.10.0",
- org.eclipse.emf.cdo.spi.common.lock;version="4.10.0",
- org.eclipse.emf.cdo.spi.common.model;version="4.10.0",
- org.eclipse.emf.cdo.spi.common.protocol;version="4.10.0",
- org.eclipse.emf.cdo.spi.common.revision;version="4.10.0"
+ org.eclipse.emf.cdo.spi.common;version="4.10.1",
+ org.eclipse.emf.cdo.spi.common.admin;version="4.10.1",
+ org.eclipse.emf.cdo.spi.common.branch;version="4.10.1",
+ org.eclipse.emf.cdo.spi.common.commit;version="4.10.1",
+ org.eclipse.emf.cdo.spi.common.id;version="4.10.1",
+ org.eclipse.emf.cdo.spi.common.lock;version="4.10.1",
+ org.eclipse.emf.cdo.spi.common.model;version="4.10.1",
+ org.eclipse.emf.cdo.spi.common.protocol;version="4.10.1",
+ org.eclipse.emf.cdo.spi.common.revision;version="4.10.1"
Automatic-Module-Name: org.eclipse.emf.cdo.common
Eclipse-RegisterBuddy: org.eclipse.net4j.util
diff --git a/plugins/org.eclipse.emf.cdo.common/pom.xml b/plugins/org.eclipse.emf.cdo.common/pom.xml
index a39ee293e8..816af48323 100644
--- a/plugins/org.eclipse.emf.cdo.common/pom.xml
+++ b/plugins/org.eclipse.emf.cdo.common/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo.common</artifactId>
- <version>4.10.0-SNAPSHOT</version>
+ <version>4.10.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
index 140224cf60..5d3a523ddf 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
@@ -338,8 +338,6 @@ public final class CDOModelUtil implements CDOModelConstants
{
return CDOType.CLOB;
}
-
- throw new IllegalArgumentException("Illegal data type: " + eDataType);
}
return CDOType.CUSTOM;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF
index e137eee69a..04e6fd5fbe 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.server.db;singleton:=true
-Bundle-Version: 4.9.0.qualifier
+Bundle-Version: 4.9.1.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -12,11 +12,11 @@ Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.net4j.db;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.server;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.server.db;version="4.9.0",
- org.eclipse.emf.cdo.server.db.mapping;version="4.9.0",
- org.eclipse.emf.cdo.server.internal.db;version="4.9.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db,org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.cdo.server.internal.db.bundle;version="4.9.0";x-internal:=true,
- org.eclipse.emf.cdo.server.internal.db.mapping;version="4.9.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
- org.eclipse.emf.cdo.server.internal.db.mapping.horizontal;version="4.9.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
- org.eclipse.emf.cdo.server.internal.db.messages;version="4.9.0";x-internal:=true
+Export-Package: org.eclipse.emf.cdo.server.db;version="4.9.1",
+ org.eclipse.emf.cdo.server.db.mapping;version="4.9.1",
+ org.eclipse.emf.cdo.server.internal.db;version="4.9.1";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db,org.eclipse.emf.cdo.explorer.ui",
+ org.eclipse.emf.cdo.server.internal.db.bundle;version="4.9.1";x-internal:=true,
+ org.eclipse.emf.cdo.server.internal.db.mapping;version="4.9.1";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
+ org.eclipse.emf.cdo.server.internal.db.mapping.horizontal;version="4.9.1";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
+ org.eclipse.emf.cdo.server.internal.db.messages;version="4.9.1";x-internal:=true
Automatic-Module-Name: org.eclipse.emf.cdo.server.db
diff --git a/plugins/org.eclipse.emf.cdo.server.db/pom.xml b/plugins/org.eclipse.emf.cdo.server.db/pom.xml
index 878be59ee1..050177cdbc 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/pom.xml
+++ b/plugins/org.eclipse.emf.cdo.server.db/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo.server.db</artifactId>
- <version>4.9.0-SNAPSHOT</version>
+ <version>4.9.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
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 ed0ccbf233..2d5a428901 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
@@ -982,13 +982,13 @@ public class CoreTypeMappings
public static class TMCustom extends AbstractTypeMapping
{
public static final Factory FACTORY_VARCHAR = new Factory(
- TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomVarchar", EcorePackage.eINSTANCE.getEDataType(), DBType.VARCHAR));
+ TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomVarchar", TypeMappingRegistry.CUSTOM_DATA_TYPE, DBType.VARCHAR));
public static final Factory FACTORY_LONG_VARCHAR = new Factory(
- TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomLongVarchar", EcorePackage.eINSTANCE.getEDataType(), DBType.LONGVARCHAR));
+ TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomLongVarchar", TypeMappingRegistry.CUSTOM_DATA_TYPE, DBType.LONGVARCHAR));
public static final Factory FACTORY_CLOB = new Factory(
- TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomClob", EcorePackage.eINSTANCE.getEDataType(), DBType.CLOB));
+ TypeMappingUtil.createDescriptor(ID_PREFIX + ".CustomClob", TypeMappingRegistry.CUSTOM_DATA_TYPE, DBType.CLOB));
@Override
protected Object getResultSetValue(ResultSet resultSet) throws SQLException
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java
index 762f331d2c..4b2902a6e1 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/TypeMappingRegistry.java
@@ -64,6 +64,8 @@ import java.util.Set;
*/
public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping.Provider
{
+ public static final EClass CUSTOM_DATA_TYPE = EcorePackage.Literals.EDATA_TYPE;
+
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, TypeMappingRegistry.class);
/**
@@ -105,12 +107,12 @@ public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping.
public DBType modify(Provider provider, IMappingStrategy mappingStrategy, EStructuralFeature feature, DBType dbType)
{
EClassifier classifier = feature.getEType();
- if (classifier == EcorePackage.eINSTANCE.getEChar())
+ if (classifier == EcorePackage.Literals.ECHAR)
{
return DBType.INTEGER;
}
- if (classifier == EcorePackage.eINSTANCE.getECharacterObject())
+ if (classifier == EcorePackage.Literals.ECHARACTER_OBJECT)
{
return DBType.INTEGER;
}
@@ -188,35 +190,35 @@ public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping.
container.registerFactory(CoreTypeMappings.TMClob.FACTORY_VARCHAR);
container.registerFactory(CoreTypeMappings.TMClob.FACTORY_LONG_VARCHAR);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEDataType(), DBType.VARCHAR);
-
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEBigDecimal(), DBType.VARCHAR);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEBigInteger(), DBType.VARCHAR);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEBoolean(), DBType.BOOLEAN);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEBooleanObject(), DBType.BOOLEAN);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEByte(), DBType.SMALLINT);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEByteObject(), DBType.SMALLINT);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEByteArray(), DBType.BLOB);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEChar(), DBType.CHAR);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getECharacterObject(), DBType.CHAR);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEDate(), DBType.TIMESTAMP);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEDouble(), DBType.DOUBLE);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEDoubleObject(), DBType.DOUBLE);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEEnum(), DBType.INTEGER);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEFloat(), DBType.FLOAT);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEFloatObject(), DBType.FLOAT);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEInt(), DBType.INTEGER);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEIntegerObject(), DBType.INTEGER);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getELong(), DBType.BIGINT);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getELongObject(), DBType.BIGINT);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEShort(), DBType.SMALLINT);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEShortObject(), DBType.SMALLINT);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEString(), DBType.VARCHAR);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEJavaClass(), DBType.VARCHAR);
- classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEJavaObject(), DBType.BLOB);
-
- classifierDefaultMapping.put(EtypesPackage.eINSTANCE.getBlob(), DBType.VARCHAR); // TODO Should be DBType.BLOB?
- classifierDefaultMapping.put(EtypesPackage.eINSTANCE.getClob(), DBType.VARCHAR); // TODO Should be DBType.CLOB?
+ classifierDefaultMapping.put(CUSTOM_DATA_TYPE, DBType.VARCHAR);
+
+ classifierDefaultMapping.put(EcorePackage.Literals.EBIG_DECIMAL, DBType.VARCHAR);
+ classifierDefaultMapping.put(EcorePackage.Literals.EBIG_INTEGER, DBType.VARCHAR);
+ classifierDefaultMapping.put(EcorePackage.Literals.EBOOLEAN, DBType.BOOLEAN);
+ classifierDefaultMapping.put(EcorePackage.Literals.EBOOLEAN_OBJECT, DBType.BOOLEAN);
+ classifierDefaultMapping.put(EcorePackage.Literals.EBYTE, DBType.SMALLINT);
+ classifierDefaultMapping.put(EcorePackage.Literals.EBYTE_OBJECT, DBType.SMALLINT);
+ classifierDefaultMapping.put(EcorePackage.Literals.EBYTE_ARRAY, DBType.BLOB);
+ classifierDefaultMapping.put(EcorePackage.Literals.ECHAR, DBType.CHAR);
+ classifierDefaultMapping.put(EcorePackage.Literals.ECHARACTER_OBJECT, DBType.CHAR);
+ classifierDefaultMapping.put(EcorePackage.Literals.EDATA_TYPE, DBType.TIMESTAMP);
+ classifierDefaultMapping.put(EcorePackage.Literals.EDOUBLE, DBType.DOUBLE);
+ classifierDefaultMapping.put(EcorePackage.Literals.EDOUBLE_OBJECT, DBType.DOUBLE);
+ classifierDefaultMapping.put(EcorePackage.Literals.EENUM, DBType.INTEGER);
+ classifierDefaultMapping.put(EcorePackage.Literals.EFLOAT, DBType.FLOAT);
+ classifierDefaultMapping.put(EcorePackage.Literals.EFLOAT_OBJECT, DBType.FLOAT);
+ classifierDefaultMapping.put(EcorePackage.Literals.EINT, DBType.INTEGER);
+ classifierDefaultMapping.put(EcorePackage.Literals.EINTEGER_OBJECT, DBType.INTEGER);
+ classifierDefaultMapping.put(EcorePackage.Literals.ELONG, DBType.BIGINT);
+ classifierDefaultMapping.put(EcorePackage.Literals.ELONG_OBJECT, DBType.BIGINT);
+ classifierDefaultMapping.put(EcorePackage.Literals.ESHORT, DBType.SMALLINT);
+ classifierDefaultMapping.put(EcorePackage.Literals.ESHORT_OBJECT, DBType.SMALLINT);
+ classifierDefaultMapping.put(EcorePackage.Literals.ESTRING, DBType.VARCHAR);
+ classifierDefaultMapping.put(EcorePackage.Literals.EJAVA_CLASS, DBType.VARCHAR);
+ classifierDefaultMapping.put(EcorePackage.Literals.EJAVA_OBJECT, DBType.BLOB);
+
+ classifierDefaultMapping.put(EtypesPackage.Literals.BLOB, DBType.VARCHAR); // TODO Should be DBType.BLOB?
+ classifierDefaultMapping.put(EtypesPackage.Literals.CLOB, DBType.VARCHAR); // TODO Should be DBType.CLOB?
}
protected IManagedContainer getContainer()
@@ -318,12 +320,12 @@ public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping.
EClassifier classifier = feature.getEType();
if (classifier instanceof EEnum)
{
- return EcorePackage.eINSTANCE.getEEnum();
+ return EcorePackage.Literals.EENUM;
}
if (classifier instanceof EClass)
{
- return EcorePackage.eINSTANCE.getEClass();
+ return EcorePackage.Literals.ECLASS;
}
EPackage ePackage = classifier.getEPackage();
@@ -334,10 +336,19 @@ public class TypeMappingRegistry implements ITypeMapping.Registry, ITypeMapping.
if (CDOModelUtil.isTypesPackage(ePackage))
{
- return classifier;
+ String name = classifier.getName();
+ if (CDOModelUtil.BLOB_CLASS_NAME.equals(name))
+ {
+ return classifier;
+ }
+
+ if (CDOModelUtil.CLOB_CLASS_NAME.equals(name))
+ {
+ return classifier;
+ }
}
- return EcorePackage.eINSTANCE.getEDataType();
+ return CUSTOM_DATA_TYPE;
}
private DBType getDBType(IMappingStrategy mappingStrategy, EStructuralFeature feature)

Back to the top