summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-16 12:45:23 (EDT)
committerEike Stepper2007-08-16 12:45:23 (EDT)
commit79cc56a78effc914738348407f75235d78db1a13 (patch)
treec445962c9b1616ee93aed610b569139d7983faa9
parentb7d75d9da3849842c5bf9fe508521bdcdafce9a4 (diff)
downloadcdo-79cc56a78effc914738348407f75235d78db1a13.zip
cdo-79cc56a78effc914738348407f75235d78db1a13.tar.gz
cdo-79cc56a78effc914738348407f75235d78db1a13.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBClassInfo.java43
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBFeatureInfo.java43
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBPackageInfo.java43
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java8
6 files changed, 148 insertions, 16 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBClassInfo.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBClassInfo.java
new file mode 100644
index 0000000..518b7df
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBClassInfo.java
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * 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.internal.db;
+
+import org.eclipse.net4j.db.IDBTable;
+
+/**
+ * @author Eike Stepper
+ */
+public final class DBClassInfo
+{
+ private int id;
+
+ private IDBTable table;
+
+ public DBClassInfo(int id)
+ {
+ this.id = id;
+ }
+
+ public int getID()
+ {
+ return id;
+ }
+
+ public IDBTable getTable()
+ {
+ return table;
+ }
+
+ public void setTable(IDBTable table)
+ {
+ this.table = table;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBFeatureInfo.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBFeatureInfo.java
new file mode 100644
index 0000000..17ea744
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBFeatureInfo.java
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * 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.internal.db;
+
+import org.eclipse.net4j.db.IDBField;
+
+/**
+ * @author Eike Stepper
+ */
+public final class DBFeatureInfo
+{
+ private int id;
+
+ private IDBField field;
+
+ public DBFeatureInfo(int id)
+ {
+ this.id = id;
+ }
+
+ public int getID()
+ {
+ return id;
+ }
+
+ public IDBField getField()
+ {
+ return field;
+ }
+
+ public void setField(IDBField field)
+ {
+ this.field = field;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBPackageInfo.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBPackageInfo.java
new file mode 100644
index 0000000..5568640
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBPackageInfo.java
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * 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.internal.db;
+
+import org.eclipse.net4j.db.IDBSchema;
+
+/**
+ * @author Eike Stepper
+ */
+public final class DBPackageInfo
+{
+ private int id;
+
+ private IDBSchema schema;
+
+ public DBPackageInfo(int id)
+ {
+ this.id = id;
+ }
+
+ public int getID()
+ {
+ return id;
+ }
+
+ public IDBSchema getSchema()
+ {
+ return schema;
+ }
+
+ public void setSchema(IDBSchema schema)
+ {
+ this.schema = schema;
+ }
+}
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 b8d26de..83fee5d 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
@@ -101,7 +101,7 @@ public class DBStoreReader implements IStoreReader
String where = CDODBSchema.PACKAGES_URI.toString() + " = '" + cdoPackage.getPackageURI() + "'";
Object[] values = DBUtil.select(connection, where, CDODBSchema.PACKAGES_ID, CDODBSchema.PACKAGES_NAME,
CDODBSchema.PACKAGES_ECORE);
- cdoPackage.setServerInfo(values[0]);
+ cdoPackage.setServerInfo(new DBPackageInfo((Integer)values[0]));
cdoPackage.setName((String)values[1]);
cdoPackage.setEcore((String)values[2]);
readClasses(cdoPackage);
@@ -118,7 +118,7 @@ public class DBStoreReader implements IStoreReader
String name = (String)values[2];
boolean isAbstract = getBoolean(values[3]);
CDOClassImpl cdoClass = new CDOClassImpl(cdoPackage, classifierID, name, isAbstract);
- cdoClass.setServerInfo(classID);
+ cdoClass.setServerInfo(new DBClassInfo(classID));
cdoPackage.addClass(cdoClass);
readSuperTypes(cdoClass, classID);
readFeatures(cdoClass, classID);
@@ -175,7 +175,7 @@ public class DBStoreReader implements IStoreReader
feature = new CDOFeatureImpl(cdoClass, featureID, name, type, many);
}
- feature.setServerInfo(values[0]);
+ feature.setServerInfo(new DBFeatureInfo((Integer)values[0]));
cdoClass.addFeature(feature);
return true;
}
@@ -187,6 +187,12 @@ public class DBStoreReader implements IStoreReader
CDODBSchema.FEATURES_REFERENCE_CLASSIFIER, CDODBSchema.FEATURES_MANY, CDODBSchema.FEATURES_CONTAINMENT);
}
+ public CDORevision readRevision(CDOID id)
+ {
+ // TODO Implement method DBStoreReader.readRevision()
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
public CDORevision readRevision(CDOID id, long timeStamp)
{
// TODO Implement method DBStoreReader.readRevision()
@@ -205,18 +211,15 @@ public class DBStoreReader implements IStoreReader
throw new UnsupportedOperationException("Not yet implemented");
}
- public CDORevision readRevision(CDOID id)
- {
- // TODO Implement method DBStoreReader.readRevision()
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
public CDOClassRef readObjectType(CDOID id)
{
// TODO Implement method DBStoreReader.readObjectType()
throw new UnsupportedOperationException("Not yet implemented");
}
+ /**
+ * TODO Move this somehow to DBAdapter
+ */
protected Boolean getBoolean(Object value)
{
if (value == null)
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 3de3349..eabb3c8 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
@@ -69,7 +69,7 @@ public class DBStoreWriter extends DBStoreReader implements IStoreWriter
public void writePackage(CDOPackageImpl cdoPackage)
{
int id = store.getNextPackageID();
- cdoPackage.setServerInfo(id);
+ cdoPackage.setServerInfo(new DBPackageInfo(id));
String packageURI = cdoPackage.getPackageURI();
String name = cdoPackage.getName();
@@ -89,7 +89,7 @@ public class DBStoreWriter extends DBStoreReader implements IStoreWriter
public void writeClass(CDOClassImpl cdoClass)
{
int id = store.getNextClassID();
- cdoClass.setServerInfo(id);
+ cdoClass.setServerInfo(new DBClassInfo(id));
CDOPackageImpl cdoPackage = cdoClass.getContainingPackage();
int packageID = (Integer)cdoPackage.getServerInfo();
@@ -119,7 +119,7 @@ public class DBStoreWriter extends DBStoreReader implements IStoreWriter
public void writeFeature(CDOFeatureImpl feature)
{
int id = store.getNextFeatureID();
- feature.setServerInfo(id);
+ feature.setServerInfo(new DBFeatureInfo(id));
int classID = (Integer)feature.getContainingClass().getServerInfo();
String name = feature.getName();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
index a95c259..dc15fff 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
@@ -34,13 +34,13 @@ public interface IStoreReader extends IStoreAccessor
*/
public void readPackage(CDOPackageImpl cdoPackage);
- public CDOID readResourceID(String path);
-
- public String readResourcePath(CDOID id);
-
public CDORevision readRevision(CDOID id);
public CDORevision readRevision(CDOID id, long timeStamp);
+ public CDOID readResourceID(String path);
+
+ public String readResourcePath(CDOID id);
+
public CDOClassRef readObjectType(CDOID id);
}