summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-14 11:07:15 (EDT)
committerEike Stepper2007-09-14 11:07:15 (EDT)
commitbcb4bc5dca959e9bd56911c03e0e3fdf41b0fae0 (patch)
treea193d5bed9dacf03b0c41bb2bf6184d0ce712bd9
parent6182b2e367ae282a8762275ec6fd15c1ee165714 (diff)
downloadcdo-bcb4bc5dca959e9bd56911c03e0e3fdf41b0fae0.zip
cdo-bcb4bc5dca959e9bd56911c03e0e3fdf41b0fae0.tar.gz
cdo-bcb4bc5dca959e9bd56911c03e0e3fdf41b0fae0.tar.bz2
[202833] Horizontal Mapping Strategy
https://bugs.eclipse.org/bugs/show_bug.cgi?id=202833
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassServerInfo.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java11
5 files changed, 22 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassServerInfo.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassServerInfo.java
index cbb44c2..c6d3eda 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassServerInfo.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassServerInfo.java
@@ -38,6 +38,9 @@ public final class ClassServerInfo extends ServerInfo
return serverInfo;
}
+ /**
+ * Should only be called from {@link MappingStrategy#getClassMapping(CDOClass)}.
+ */
public static IClassMapping getClassMapping(CDOClass cdoClass)
{
ClassServerInfo serverInfo = getServerInfo(cdoClass);
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index c9606da..bac65af 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -391,7 +391,9 @@ public class DBStoreAccessor implements IDBStoreAccessor
}
CDOClassImpl cdoClass = revision.getCDOClass();
- IClassMapping mapping = ClassServerInfo.getClassMapping(cdoClass);
+
+ IMappingStrategy mappingStrategy = store.getMappingStrategy();
+ IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
mapping.writeRevision(this, revision);
}
@@ -426,7 +428,8 @@ public class DBStoreAccessor implements IDBStoreAccessor
CDOClassImpl cdoClass = getObjectType(id);
CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
- IClassMapping mapping = ClassServerInfo.getClassMapping(cdoClass);
+ IMappingStrategy mappingStrategy = store.getMappingStrategy();
+ IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
mapping.readRevision(this, revision, referenceChunk);
return revision;
}
@@ -442,7 +445,8 @@ public class DBStoreAccessor implements IDBStoreAccessor
CDOClassImpl cdoClass = getObjectType(id);
CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
- IClassMapping mapping = ClassServerInfo.getClassMapping(cdoClass);
+ IMappingStrategy mappingStrategy = store.getMappingStrategy();
+ IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
mapping.readRevisionByTime(this, revision, timeStamp, referenceChunk);
return revision;
}
@@ -458,7 +462,8 @@ public class DBStoreAccessor implements IDBStoreAccessor
CDOClassImpl cdoClass = getObjectType(id);
CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
- IClassMapping mapping = ClassServerInfo.getClassMapping(cdoClass);
+ IMappingStrategy mappingStrategy = store.getMappingStrategy();
+ IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
mapping.readRevisionByVersion(this, revision, version, referenceChunk);
return revision;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
index 376514d..a9af71d 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
@@ -55,7 +55,7 @@ public class HorizontalMappingStrategy extends MappingStrategy
IPackageManager packageManager = getStore().getRepository().getPackageManager();
for (CDOPackage cdoPackage : packageManager.getPackages())
{
- for (CDOClass cdoClass : cdoPackage.getClasses())
+ for (CDOClass cdoClass : cdoPackage.getConcreteClasses())
{
result.add(cdoClass);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
index fe2d41b..4bb400e 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
@@ -236,7 +236,7 @@ public abstract class MappingStrategy implements IMappingStrategy
while (classIt.hasNext())
{
CDOClass cdoClass = classIt.next();
- IClassMapping mapping = ClassServerInfo.getClassMapping(cdoClass);
+ IClassMapping mapping = getClassMapping(cdoClass);
if (mapping != null)
{
IDBTable table = mapping.getTable();
@@ -279,7 +279,7 @@ public abstract class MappingStrategy implements IMappingStrategy
String suffix = " WHERE " + CDODBSchema.ATTRIBUTES_ID + "=" + id;
for (CDOClass cdoClass : getClassesWithObjectInfo())
{
- IClassMapping mapping = ClassServerInfo.getClassMapping(cdoClass);
+ IClassMapping mapping = getClassMapping(cdoClass);
if (mapping != null)
{
IDBTable table = mapping.getTable();
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index 11f13dd..9d56906 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -1893,10 +1893,13 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
MenuManager submenuManager = new MenuManager(cdoPackage.getPackageURI());
for (CDOClass cdoClass : cdoClasses)
{
- // TODO Optimize/cache this?
- CreateRootAction action = new CreateRootAction(cdoClass);
- submenuManager.add(action);
- populated = true;
+ if (!cdoClass.isResource())
+ {
+ // TODO Optimize/cache this?
+ CreateRootAction action = new CreateRootAction(cdoClass);
+ submenuManager.add(action);
+ populated = true;
+ }
}
menuManager.add(submenuManager);