summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-16 16:01:07 (EDT)
committerEike Stepper2007-08-16 16:01:07 (EDT)
commit9aea5261ada37350d1445e95273dab5dd371f961 (patch)
treeeb3a0ca004f4ee8cf03a99664b00de6f89be779b
parent2fbb584822d382ee8be2ab5d3757683beb9b8e8e (diff)
downloadcdo-9aea5261ada37350d1445e95273dab5dd371f961.zip
cdo-9aea5261ada37350d1445e95273dab5dd371f961.tar.gz
cdo-9aea5261ada37350d1445e95273dab5dd371f961.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/config/cdo.server.xml3
5 files changed, 13 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
index 19b3368..c3b41a2 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
@@ -56,6 +56,7 @@ public class DBStore extends Store
throw new IllegalArgumentException("dataSource is null");
}
+ this.mappingStrategy = mappingStrategy;
this.dbAdapter = dbAdapter;
this.dataSource = dataSource;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java
index 50d3418..1586b0f 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java
@@ -47,7 +47,9 @@ public class DBStoreFactory implements IStoreFactory
IMappingStrategy mappingStrategy = getMappingStrategy(storeConfig);
IDBAdapter dbAdapter = getDBAdapter(storeConfig);
DataSource dataSource = getDataSource(storeConfig);
- return new DBStore(mappingStrategy, dbAdapter, dataSource);
+ DBStore store = new DBStore(mappingStrategy, dbAdapter, dataSource);
+ mappingStrategy.setStore(store);
+ return store;
}
private IMappingStrategy getMappingStrategy(Element storeConfig)
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 7fb909c..1e4d1c7 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
@@ -98,7 +98,7 @@ public class DBStoreWriter extends DBStoreReader implements IStoreWriter
cdoClass.setServerInfo(new DBClassInfo(id));
CDOPackageImpl cdoPackage = cdoClass.getContainingPackage();
- int packageID = (Integer)cdoPackage.getServerInfo();
+ int packageID = ((DBPackageInfo)cdoPackage.getServerInfo()).getID();
int classifierID = cdoClass.getClassifierID();
String name = cdoClass.getName();
boolean isAbstract = cdoClass.isAbstract();
@@ -127,7 +127,7 @@ public class DBStoreWriter extends DBStoreReader implements IStoreWriter
int id = store.getNextFeatureID();
feature.setServerInfo(new DBFeatureInfo(id));
- int classID = (Integer)feature.getContainingClass().getServerInfo();
+ int classID = ((DBClassInfo)feature.getContainingClass().getServerInfo()).getID();
String name = feature.getName();
int featureID = feature.getFeatureID();
int type = feature.getType().getTypeID();
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 b0a51d7..88624fc 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
@@ -51,7 +51,6 @@ public abstract class MappingStrategy implements IMappingStrategy
public void setStore(IStore store)
{
this.store = store;
- schema = createSchema();
}
public Properties getProperties()
@@ -77,6 +76,11 @@ public abstract class MappingStrategy implements IMappingStrategy
public IDBTable[] map(CDOPackage cdoPackage)
{
+ if (schema == null)
+ {
+ schema = createSchema();
+ }
+
Set<IDBTable> affectedTables = new HashSet();
((DBPackageInfo)cdoPackage.getServerInfo()).setSchema(schema);
for (CDOClass cdoClass : cdoPackage.getClasses())
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 f340910..1314671 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,8 @@
<repository name="repo1">
<store type="db">
- <dbAdapter type="derby"/>
+ <mappingStrategy type="Horizontal"/>
+ <dbAdapter name="derby"/>
<dataSource
driverClass="org.apache.derby.jdbc.EmbeddedDataSource"
databaseName="C:/temp/cdodb1"