summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-25 03:00:31 (EDT)
committerEike Stepper2007-08-25 03:00:31 (EDT)
commit7fa6b103d0e2b190363e04c29498b2c3e5fba06c (patch)
treedf5c11a0dcdec6a75c8aba1fe06430434038bf53
parentb73f865ea45713ccdb12baf6e04a5e89fd8b62a0 (diff)
downloadcdo-7fa6b103d0e2b190363e04c29498b2c3e5fba06c.zip
cdo-7fa6b103d0e2b190363e04c29498b2c3e5fba06c.tar.gz
cdo-7fa6b103d0e2b190363e04c29498b2c3e5fba06c.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java34
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java7
-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/RootMapping.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java7
8 files changed, 65 insertions, 10 deletions
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 68d1a32..fdc9463 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
@@ -31,4 +31,6 @@ public interface IMapping
public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
+
+ public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp);
}
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 58bb358..85386ee 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
@@ -10,7 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.db;
+import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
+import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import java.util.Map;
@@ -36,4 +38,6 @@ public interface IMappingStrategy
public void setProperties(Map<String, String> properties);
public IMapping getMapping(CDOClass cdoClass);
+
+ public CDOClassRef readObjectType(CDOID id);
}
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 12fecc2..b498dda 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
@@ -381,10 +381,7 @@ public class DBStoreAccessor implements IDBStoreAccessor
TRACER.format("Selecting revision: {0}", id);
}
- IRepository repository = store.getRepository();
- IPackageManager packageManager = repository.getPackageManager();
- CDOClassRef type = repository.getObjectType(this, id);
- CDOClassImpl cdoClass = (CDOClassImpl)type.resolve(packageManager);
+ CDOClassImpl cdoClass = getObjectType(id);
CDORevisionImpl revision = new CDORevisionImpl(cdoClass, id);
IMapping mapping = ClassServerInfo.getMapping(cdoClass);
@@ -394,8 +391,17 @@ public class DBStoreAccessor implements IDBStoreAccessor
public CDORevision readRevision(CDOID id, long timeStamp)
{
- // TODO Implement method DBStoreAccessor.enclosing_method()
- throw new UnsupportedOperationException("Not yet implemented");
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Selecting revision: {0}", id);
+ }
+
+ CDOClassImpl cdoClass = getObjectType(id);
+ CDORevisionImpl revision = new CDORevisionImpl(cdoClass, id);
+
+ IMapping mapping = ClassServerInfo.getMapping(cdoClass);
+ mapping.readRevision(this, revision, timeStamp);
+ return revision;
}
public CDOID readResourceID(String path)
@@ -412,8 +418,12 @@ public class DBStoreAccessor implements IDBStoreAccessor
public CDOClassRef readObjectType(CDOID id)
{
- // TODO Implement method DBStoreAccessor.readObjectType()
- throw new UnsupportedOperationException("Not yet implemented");
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Selecting object type: {0}", id);
+ }
+
+ return store.getMappingStrategy().readObjectType(id);
}
/**
@@ -439,6 +449,14 @@ public class DBStoreAccessor implements IDBStoreAccessor
throw new IllegalArgumentException("Not a boolean value: " + value);
}
+ protected CDOClassImpl getObjectType(CDOID id)
+ {
+ IRepository repository = store.getRepository();
+ IPackageManager packageManager = repository.getPackageManager();
+ CDOClassRef type = repository.getObjectType(this, id);
+ return (CDOClassImpl)type.resolve(packageManager);
+ }
+
protected Set<IDBTable> mapPackages(CDOPackageImpl... cdoPackages)
{
Set<IDBTable> affectedTables = new HashSet();
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 669884d..4edc720 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,7 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
+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.server.db.IMapping;
/**
@@ -32,6 +34,11 @@ public class HorizontalMappingStrategy extends MappingStrategy
return false;
}
+ public CDOClassRef readObjectType(CDOID id)
+ {
+ return null;
+ }
+
@Override
protected IMapping createMapping(CDOClass cdoClass)
{
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 d167631..f7897d4 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
@@ -54,4 +54,8 @@ public class NoMapping implements IMapping
public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
}
+
+ public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ {
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
index 198dd30..60071fe 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java
@@ -48,6 +48,12 @@ public class RootMapping extends Mapping
throw new UnsupportedOperationException("Not yet implemented");
}
+ public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ {
+ // TODO Implement method RootMapping.readRevision()
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
private static CDOObjectClass getRootClass(VerticalMappingStrategy mappingStrategy)
{
return mappingStrategy.getStore().getRepository().getPackageManager().getCDOCorePackage().getCDOObjectClass();
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
index 2e01a45..b9bd1a4 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java
@@ -29,6 +29,8 @@ import java.util.List;
*/
public abstract class ValueMapping extends Mapping
{
+ private static final long NO_TIMESTAMP = 0L;
+
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, ValueMapping.class);
private List<IAttributeMapping> attributeMappings;
@@ -68,9 +70,14 @@ public abstract class ValueMapping extends Mapping
public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
{
+ readRevision(storeAccessor, revision, NO_TIMESTAMP);
+ }
+
+ public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ {
if (attributeMappings != null)
{
- readAttributes(storeAccessor, revision);
+ readAttributes(storeAccessor, revision, timeStamp);
}
if (referenceMappings != null)
@@ -105,7 +112,7 @@ public abstract class ValueMapping extends Mapping
}
}
- protected void readAttributes(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
+ protected void readAttributes(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
{
IDBField[] fields = getTable().getFields();
StringBuilder builder = new StringBuilder();
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 e5155c0..600d429 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,7 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
+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.server.db.IMapping;
/**
@@ -35,6 +37,11 @@ public class VerticalMappingStrategy extends MappingStrategy
return true;
}
+ public CDOClassRef readObjectType(CDOID id)
+ {
+ return null;
+ }
+
public RootMapping getRootMapping()
{
if (rootMapping == null)