summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-20 02:02:51 (EDT)
committerEike Stepper2007-08-20 02:02:51 (EDT)
commitb39e7f42221bd11f483d9d629089feba4f290e42 (patch)
tree1e74a7b1b33222b01576a7dae7b9ce67c8cf7a0a
parentb1808e58f09bb953fa3abec4a1d30de4e06eb57c (diff)
downloadcdo-b39e7f42221bd11f483d9d629089feba4f290e42.zip
cdo-b39e7f42221bd11f483d9d629089feba4f290e42.tar.gz
cdo-b39e7f42221bd11f483d9d629089feba4f290e42.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java2
-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/HorizontalMappingStrategy.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java8
5 files changed, 23 insertions, 11 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 ecedbfa..aefb938 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
@@ -10,7 +10,6 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.server.PackageManager;
import org.eclipse.emf.cdo.internal.server.Store;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IView;
@@ -77,6 +76,11 @@ public class DBStore extends Store implements IDBStore
return dataSource;
}
+ public boolean hasAuditSupport()
+ {
+ return true;
+ }
+
public DBStoreReader getReader(ISession session) throws DBException
{
return new DBStoreReader(this);
@@ -116,11 +120,12 @@ public class DBStore extends Store implements IDBStore
nextClassID = DBUtil.selectMaximum(connection, CDODBSchema.CLASSES_ID) + 1;
nextFeatureID = DBUtil.selectMaximum(connection, CDODBSchema.FEATURES_ID) + 1;
- if (nextPackageID == 1)
- {
- PackageManager packageManager = (PackageManager)getRepository().getPackageManager();
- writer.writePackages(packageManager.getCDOResourcePackage());
- }
+ // if (nextPackageID == 1)
+ // {
+ // PackageManager packageManager =
+ // (PackageManager)getRepository().getPackageManager();
+ // writer.writePackages(packageManager.getCDOResourcePackage());
+ // }
writer.release();
}
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 a4c7c13..b9f44e5 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
@@ -90,7 +90,7 @@ public class DBStoreReader implements IStoreReader
boolean dynamic = getBoolean(values[1]);
long rangeLB = (Long)values[2];
long rangeUB = (Long)values[3];
- CDOIDRange metaIDRange = CDOIDRangeImpl.create(rangeLB, rangeUB);
+ CDOIDRange metaIDRange = rangeLB == 0L && rangeUB == 0L ? null : CDOIDRangeImpl.create(rangeLB, rangeUB);
result.add(new CDOPackageInfo(packageURI, dynamic, metaIDRange));
return true;
}
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 cd232c2..c1ccda8 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
@@ -89,8 +89,8 @@ public class DBStoreWriter extends DBStoreReader implements IStoreWriter
String ecore = cdoPackage.getEcore();
boolean dynamic = cdoPackage.isDynamic();
CDOIDRange metaIDRange = cdoPackage.getMetaIDRange();
- long lb = metaIDRange.getLowerBound().getValue();
- long ub = metaIDRange.getUpperBound().getValue();
+ long lb = metaIDRange == null ? 0L : metaIDRange.getLowerBound().getValue();
+ long ub = metaIDRange == null ? 0L : metaIDRange.getUpperBound().getValue();
DBUtil.insertRow(connection, CDODBSchema.PACKAGES, id, packageURI, name, ecore, dynamic, lb, ub);
for (CDOClassImpl cdoClass : cdoPackage.getClasses())
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 2326719..0fea91f 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
@@ -99,7 +99,8 @@ public class HorizontalMappingStrategy extends MappingStrategy
int i = 8;
for (CDOFeatureImpl feature : cdoClass.getAllFeatures())
{
- values[i++] = revision.getValue(feature);
+ Object value = revision.getValue(feature);
+ values[i++] = value instanceof CDOID ? ((CDOID)value).getValue() : value;
}
DBUtil.insertRow(connection, table, values);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
index a62ee4b..0ded996 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
@@ -17,9 +17,15 @@ import org.eclipse.net4j.internal.util.lifecycle.LifecycleEventAdapter;
*/
public interface IStore extends IRepositoryElement
{
+ public void setRepository(IRepository repository);
+
public String getStoreType();
- public void setRepository(IRepository repository);
+ /**
+ * @return <code>true</code> if this store supports audit views,
+ * <code>false</code> otherwise.
+ */
+ public boolean hasAuditSupport();
/**
* Returns a reader that can be used to read from this store in the context of