Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-11-03 07:54:04 -0500
committerEike Stepper2008-11-03 07:54:04 -0500
commit6492822b5c84e813309f0b9e07f513d7969c084c (patch)
tree6274abbb1f29b92dfb66d54f30720453dace1ce7
parent698f56e9d769e631cc8f0f77712c4bd17627ec21 (diff)
downloadcdo-6492822b5c84e813309f0b9e07f513d7969c084c.tar.gz
cdo-6492822b5c84e813309f0b9e07f513d7969c084c.tar.xz
cdo-6492822b5c84e813309f0b9e07f513d7969c084c.zip
[250466] Problem with ReferenceMapping and generalization
https://bugs.eclipse.org/bugs/show_bug.cgi?id=250466
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java12
3 files changed, 23 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
index c0d07f3dfd..c079172f37 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
@@ -407,6 +407,11 @@ public abstract class ClassMapping implements IClassMapping
return new ReferenceMapping(this, feature, ToMany.PER_REFERENCE);
}
+ public Object createReferenceMappingKey(CDOFeature cdoFeature)
+ {
+ return cdoFeature;
+ }
+
protected abstract boolean hasFullRevisionInfo();
public void writeRevision(IDBStoreAccessor accessor, CDORevision revision)
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java
index f31b86275e..69898ee97a 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java
@@ -19,6 +19,8 @@ import org.eclipse.emf.cdo.server.IPackageManager;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
+import org.eclipse.net4j.util.collection.Pair;
+
/**
* @author Eike Stepper
*/
@@ -68,6 +70,12 @@ public class HorizontalClassMapping extends ClassMapping
}
@Override
+ public Object createReferenceMappingKey(CDOFeature cdoFeature)
+ {
+ return new Pair<CDOClass, CDOFeature>(getCDOClass(), cdoFeature);
+ }
+
+ @Override
protected boolean hasFullRevisionInfo()
{
return true;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
index bd9aca9c7a..cafe2956d5 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
@@ -241,10 +241,13 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
switch (toMany)
{
case PER_REFERENCE:
+ {
withFeature = false;
- table = mapReferenceTable(cdoFeature, mappingStrategy.getTableName(cdoClass) + "_" + cdoFeature.getName()
- + "_refs");
+ String tableName = mappingStrategy.getTableName(cdoClass) + "_" + cdoFeature.getName() + "_refs";
+ Object referenceMappingKey = getReferenceMappingKey(cdoFeature);
+ table = mapReferenceTable(referenceMappingKey, tableName);
break;
+ }
case PER_CLASS:
withFeature = true;
@@ -268,6 +271,11 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
}
}
+ protected Object getReferenceMappingKey(CDOFeature cdoFeature)
+ {
+ return getClassMapping().createReferenceMappingKey(cdoFeature);
+ }
+
protected IDBTable mapReferenceTable(Object key, String tableName)
{
Map<Object, IDBTable> referenceTables = getClassMapping().getMappingStrategy().getReferenceTables();

Back to the top