summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-24 05:19:09 (EDT)
committerEike Stepper2007-08-24 05:19:09 (EDT)
commit0b09585b20a8dbca4eb6f69f216390438a61e6b4 (patch)
tree578b7f64ce957e04add02906eb439e09674afdb6
parentfb6598aefaeb7c1c6d1e55558090293c84da0066 (diff)
downloadcdo-0b09585b20a8dbca4eb6f69f216390438a61e6b4.zip
cdo-0b09585b20a8dbca4eb6f69f216390438a61e6b4.tar.gz
cdo-0b09585b20a8dbca4eb6f69f216390438a61e6b4.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java7
-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.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java15
7 files changed, 27 insertions, 24 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java
index 801fd50..7e75541 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java
@@ -20,7 +20,6 @@ public class HorizontalMapping extends ValueMapping
public HorizontalMapping(HorizontalMappingStrategy mappingStrategy, CDOClass cdoClass)
{
super(mappingStrategy, cdoClass, cdoClass.getAllFeatures());
- mappingStrategy.initTable(getTable(), true);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
index 74ec5ea..4aa3fa4 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOType;
import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IMapping;
-import org.eclipse.emf.cdo.server.db.IMappingStrategy;
import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.net4j.db.DBException;
@@ -39,7 +38,7 @@ public abstract class Mapping implements IMapping
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, Mapping.class);
- private IMappingStrategy mappingStrategy;
+ private MappingStrategy mappingStrategy;
private CDOClass cdoClass;
@@ -47,14 +46,14 @@ public abstract class Mapping implements IMapping
private Set<IDBTable> affectedTables = new HashSet();
- public Mapping(IMappingStrategy mappingStrategy, CDOClass cdoClass)
+ public Mapping(MappingStrategy mappingStrategy, CDOClass cdoClass)
{
this.mappingStrategy = mappingStrategy;
this.cdoClass = cdoClass;
table = addTable(cdoClass.getName());
}
- public IMappingStrategy getMappingStrategy()
+ public MappingStrategy getMappingStrategy()
{
return mappingStrategy;
}
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 e1af4a7..5ce4732 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
@@ -122,8 +122,6 @@ public abstract class MappingStrategy implements IMappingStrategy
return mapping;
}
- protected abstract IMapping createMapping(CDOClass cdoClass);
-
@Override
public String toString()
{
@@ -144,4 +142,6 @@ public abstract class MappingStrategy implements IMappingStrategy
table.addField("cdo_feature", DBType.INTEGER);
}
}
+
+ protected abstract IMapping createMapping(CDOClass cdoClass);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
index f51da87..5f76529 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
@@ -11,18 +11,24 @@
package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.protocol.model.CDOClass;
+import org.eclipse.emf.cdo.protocol.model.core.CDOObjectClass;
import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
-import org.eclipse.emf.cdo.server.db.IMappingStrategy;
/**
* @author Eike Stepper
*/
public class RootMapping extends Mapping
{
- public RootMapping(IMappingStrategy mappingStrategy, CDOClass cdoClass)
+ public RootMapping(VerticalMappingStrategy mappingStrategy)
{
- super(mappingStrategy, cdoClass);
+ super(mappingStrategy, getRootClass(mappingStrategy));
+ mappingStrategy.initTable(getTable(), true);
+ }
+
+ @Override
+ public VerticalMappingStrategy getMappingStrategy()
+ {
+ return (VerticalMappingStrategy)super.getMappingStrategy();
}
public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
@@ -35,4 +41,9 @@ public class RootMapping extends Mapping
builder.append(")");
executeSQL(storeAccessor, builder.toString());
}
+
+ private static CDOObjectClass getRootClass(VerticalMappingStrategy mappingStrategy)
+ {
+ return mappingStrategy.getStore().getRepository().getPackageManager().getCDOCorePackage().getCDOObjectClass();
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
index 97fdfc9..f3e65b7 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
@@ -15,7 +15,6 @@ import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.server.db.IAttributeMapping;
import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
-import org.eclipse.emf.cdo.server.db.IMappingStrategy;
import org.eclipse.emf.cdo.server.db.IReferenceMapping;
import java.util.List;
@@ -29,9 +28,10 @@ public abstract class ValueMapping extends Mapping
private List<IReferenceMapping> referenceMappings;
- public ValueMapping(IMappingStrategy mappingStrategy, CDOClass cdoClass, CDOFeature[] features)
+ public ValueMapping(MappingStrategy mappingStrategy, CDOClass cdoClass, CDOFeature[] features)
{
super(mappingStrategy, cdoClass);
+ mappingStrategy.initTable(getTable(), hasFullRevisionInfo());
attributeMappings = createAttributeMappings(features);
referenceMappings = createReferenceMappings(features);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java
index 0bf3600..a91a59b 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java
@@ -28,7 +28,6 @@ public class VerticalMapping extends ValueMapping
public VerticalMapping(VerticalMappingStrategy mappingStrategy, CDOClass cdoClass)
{
super(mappingStrategy, cdoClass, cdoClass.getFeatures());
- mappingStrategy.initTable(getTable(), false);
for (CDOClass superType : cdoClass.getSuperTypes())
{
IMapping superMapping = mappingStrategy.getMapping(superType);
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
index 9630e97..f3034f9 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
@@ -13,15 +13,12 @@ package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.server.db.IMapping;
-import org.eclipse.net4j.db.IDBSchema;
-import org.eclipse.net4j.db.IDBTable;
-
/**
* @author Eike Stepper
*/
public class VerticalMappingStrategy extends MappingStrategy
{
- private IDBTable rootTable;
+ private RootMapping rootMapping;
public VerticalMappingStrategy()
{
@@ -33,16 +30,14 @@ public class VerticalMappingStrategy extends MappingStrategy
return "vertical";
}
- public IDBTable getRootTable()
+ public RootMapping getRootMapping()
{
- if (rootTable == null)
+ if (rootMapping == null)
{
- IDBSchema schema = getStore().getSchema();
- rootTable = schema.addTable("cdo_revisions");
- initTable(rootTable, true);
+ rootMapping = new RootMapping(this);
}
- return rootTable;
+ return rootMapping;
}
@Override