summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-17 13:02:54 (EDT)
committerEike Stepper2007-08-17 13:02:54 (EDT)
commit711000ff50c825461d5cdfe8f542542c115ba022 (patch)
tree9881052ecb32d0d28834a47e5d90f0b782ab8a27
parent5d9ae47b55fa4d30eb01b46bfd30aeec260fafcb (diff)
downloadcdo-711000ff50c825461d5cdfe8f542542c115ba022.zip
cdo-711000ff50c825461d5cdfe8f542542c115ba022.tar.gz
cdo-711000ff50c825461d5cdfe8f542542c115ba022.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java34
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java34
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml4
6 files changed, 94 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
index f4ea8f8..645dd33 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java
@@ -11,10 +11,15 @@
package org.eclipse.emf.cdo.server.db;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.net4j.db.IDBSchema;
import org.eclipse.net4j.db.IDBTable;
+import java.sql.Connection;
import java.util.Properties;
import java.util.Set;
@@ -39,4 +44,16 @@ public interface IMappingStrategy
* @return A collection of the affected tables.
*/
public Set<IDBTable> map(CDOPackageImpl[] cdoPackages);
+
+ public void writeRevision(Connection connection, CDORevisionImpl revision);
+
+ public CDORevision readRevision(Connection connection, CDOID id);
+
+ public CDORevision readRevision(Connection connection, CDOID id, long timeStamp);
+
+ public CDOID readResourceID(Connection connection, String path);
+
+ public String readResourcePath(Connection connection, CDOID id);
+
+ public CDOClassRef readObjectType(Connection connection, CDOID id);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
index 88e82f6..a8e846f 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
@@ -192,32 +192,27 @@ public class DBStoreReader implements IStoreReader
public CDORevision readRevision(CDOID id)
{
- // TODO Implement method DBStoreReader.readRevision()
- throw new UnsupportedOperationException("Not yet implemented");
+ return store.getMappingStrategy().readRevision(connection, id);
}
public CDORevision readRevision(CDOID id, long timeStamp)
{
- // TODO Implement method DBStoreReader.readRevision()
- throw new UnsupportedOperationException("Not yet implemented");
+ return store.getMappingStrategy().readRevision(connection, id, timeStamp);
}
public CDOID readResourceID(String path)
{
- // TODO Implement method DBStoreReader.readResourceID()
- throw new UnsupportedOperationException("Not yet implemented");
+ return store.getMappingStrategy().readResourceID(connection, path);
}
public String readResourcePath(CDOID id)
{
- // TODO Implement method DBStoreReader.readResourcePath()
- throw new UnsupportedOperationException("Not yet implemented");
+ return store.getMappingStrategy().readResourcePath(connection, id);
}
public CDOClassRef readObjectType(CDOID id)
{
- // TODO Implement method DBStoreReader.readObjectType()
- throw new UnsupportedOperationException("Not yet implemented");
+ return store.getMappingStrategy().readObjectType(connection, id);
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
index eb5edd7..0c95a53 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
@@ -147,5 +147,6 @@ public class DBStoreWriter extends DBStoreReader implements IStoreWriter
public void writeRevision(CDORevisionImpl revision)
{
+ store.getMappingStrategy().writeRevision(connection, 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 e53e6b4..451a5f8 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
@@ -10,12 +10,17 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
+import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.net4j.db.IDBField;
import org.eclipse.net4j.db.IDBTable;
+import java.sql.Connection;
import java.util.Set;
/**
@@ -57,4 +62,33 @@ public class HorizontalMappingStrategy extends MappingStrategy
IDBTable table = classInfo.getTable();
return addField(cdoFeature, table);
}
+
+ public void writeRevision(Connection connection, CDORevisionImpl revision)
+ {
+ }
+
+ public CDORevision readRevision(Connection connection, CDOID id)
+ {
+ return null;
+ }
+
+ public CDORevision readRevision(Connection connection, CDOID id, long timeStamp)
+ {
+ return null;
+ }
+
+ public CDOID readResourceID(Connection connection, String path)
+ {
+ return null;
+ }
+
+ public String readResourcePath(Connection connection, CDOID id)
+ {
+ return null;
+ }
+
+ public CDOClassRef readObjectType(Connection connection, CDOID id)
+ {
+ return null;
+ }
}
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 593af15..d6d7b05 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
@@ -10,13 +10,18 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
+import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.net4j.db.IDBField;
import org.eclipse.net4j.db.IDBSchema;
import org.eclipse.net4j.db.IDBTable;
+import java.sql.Connection;
import java.util.Set;
/**
@@ -67,4 +72,33 @@ public class VerticalMappingStrategy extends MappingStrategy
IDBTable table = classInfo.getTable();
return addField(cdoFeature, table);
}
+
+ public void writeRevision(Connection connection, CDORevisionImpl revision)
+ {
+ }
+
+ public CDORevision readRevision(Connection connection, CDOID id)
+ {
+ return null;
+ }
+
+ public CDORevision readRevision(Connection connection, CDOID id, long timeStamp)
+ {
+ return null;
+ }
+
+ public CDOID readResourceID(Connection connection, String path)
+ {
+ return null;
+ }
+
+ public String readResourcePath(Connection connection, CDOID id)
+ {
+ return null;
+ }
+
+ public CDOClassRef readObjectType(Connection connection, CDOID id)
+ {
+ return null;
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml b/plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml
index a37ef6e..f6e9644 100644
--- a/plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml
+++ b/plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml
@@ -3,7 +3,9 @@
<repository name="repo1">
<store type="db">
- <mappingStrategy type="horizontal"/>
+ <mappingStrategy type="horizontal">
+ <property name="referenceMapping" value="ONE_TABLE_PER_REFERENCE"/>
+ </mappingStrategy>
<dbAdapter name="derby"/>
<dataSource
driverClass="org.apache.derby.jdbc.EmbeddedDataSource"