summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-23 07:36:43 (EDT)
committerEike Stepper2007-08-23 07:36:43 (EDT)
commitf0b0152712066001f30d840980b5909e366e898b (patch)
tree40b9c7d6d7641a434487722cc1aeb835ae7adc48
parente387d081334198c83a1e6eb5d4377477687fc273 (diff)
downloadcdo-f0b0152712066001f30d840980b5909e366e898b.zip
cdo-f0b0152712066001f30d840980b5909e366e898b.tar.gz
cdo-f0b0152712066001f30d840980b5909e366e898b.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FullInfoMapping.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IDInfoMapping.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java17
9 files changed, 55 insertions, 26 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java
new file mode 100644
index 0000000..5581180
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStoreAccessor.java
@@ -0,0 +1,24 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.server.db;
+
+import org.eclipse.emf.cdo.server.IStoreReader;
+import org.eclipse.emf.cdo.server.IStoreWriter;
+
+import java.sql.Connection;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IDBStoreAccessor extends IStoreReader, IStoreWriter
+{
+ public Connection getConnection();
+}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java
index 8010982..a3f5398 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java
@@ -12,7 +12,6 @@ package org.eclipse.emf.cdo.server.db;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
-import org.eclipse.emf.cdo.server.IStoreWriter;
import org.eclipse.net4j.db.IDBTable;
@@ -29,5 +28,5 @@ public interface IMapping
public Set<IDBTable> getAffectedTables();
- public void writeRevision(IStoreWriter writer, CDORevisionImpl revision);
+ public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
}
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 087d1b5..3584bb8 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
@@ -25,9 +25,8 @@ import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.model.CDOType;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.ISession;
-import org.eclipse.emf.cdo.server.IStoreReader;
-import org.eclipse.emf.cdo.server.IStoreWriter;
import org.eclipse.emf.cdo.server.IView;
+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;
@@ -46,7 +45,7 @@ import java.util.Collection;
/**
* @author Eike Stepper
*/
-public class DBStoreAccessor implements IStoreReader, IStoreWriter
+public class DBStoreAccessor implements IDBStoreAccessor
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, DBStoreAccessor.class);
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FullInfoMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FullInfoMapping.java
index bc5f2ab..7efcb84 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FullInfoMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/FullInfoMapping.java
@@ -12,7 +12,7 @@ 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.server.IStoreWriter;
+import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
/**
@@ -26,13 +26,13 @@ public abstract class FullInfoMapping extends IDInfoMapping
}
@Override
- public void writeRevision(IStoreWriter writer, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
- super.writeRevision(writer, revision);
- writeFullInfo(writer, revision);
+ super.writeRevision(storeAccessor, revision);
+ writeFullInfo(storeAccessor, revision);
}
- protected void writeFullInfo(IStoreWriter writer, CDORevisionImpl revision)
+ protected void writeFullInfo(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
}
}
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 436b731..00174a2 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
@@ -12,7 +12,7 @@ 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.server.IStoreWriter;
+import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
/**
@@ -26,8 +26,8 @@ public class HorizontalMapping extends FullInfoMapping
}
@Override
- public void writeRevision(IStoreWriter writer, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
- super.writeRevision(writer, revision);
+ super.writeRevision(storeAccessor, revision);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IDInfoMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IDInfoMapping.java
index 6d960c5..6d90f77 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IDInfoMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/IDInfoMapping.java
@@ -12,7 +12,7 @@ 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.server.IStoreWriter;
+import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
/**
@@ -25,12 +25,12 @@ public abstract class IDInfoMapping extends Mapping
super(mappingStrategy, cdoClass);
}
- public void writeRevision(IStoreWriter writer, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
- writeIDInfo(writer, revision);
+ writeIDInfo(storeAccessor, revision);
}
- protected void writeIDInfo(IStoreWriter writer, CDORevisionImpl revision)
+ protected void writeIDInfo(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
}
}
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 ae78a0a..889c8ab 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
@@ -50,8 +50,4 @@ public abstract class Mapping implements IMapping
{
return affectedTables;
}
-
- // protected abstract List<FeatureMapper> getAttributeMappers();
- //
- // protected abstract List<FeatureMapper> getReferenceMappers();
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java
index 7dcbf63..234f549 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java
@@ -12,7 +12,7 @@ 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.server.IStoreWriter;
+import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IMapping;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
@@ -47,7 +47,7 @@ public class NoMapping implements IMapping
return Collections.emptySet();
}
- public void writeRevision(IStoreWriter writer, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
}
}
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 7ca02dc..209816b 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
@@ -13,6 +13,7 @@ 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.server.IStoreWriter;
+import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IMapping;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
@@ -50,15 +51,25 @@ public class VerticalMapping extends IDInfoMapping
}
@Override
- public void writeRevision(IStoreWriter writer, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
- super.writeRevision(writer, revision);
+ super.writeRevision(storeAccessor, revision);
+ writeAttributes(storeAccessor, revision);
+ writeReferences(storeAccessor, revision);
if (superMappings != null)
{
for (IMapping superMapping : superMappings)
{
- superMapping.writeRevision(writer, revision);
+ superMapping.writeRevision(storeAccessor, revision);
}
}
}
+
+ protected void writeAttributes(IStoreWriter writer, CDORevisionImpl revision)
+ {
+ }
+
+ protected void writeReferences(IStoreWriter writer, CDORevisionImpl revision)
+ {
+ }
}