summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-12 02:55:24 (EDT)
committerEike Stepper2007-09-12 02:55:24 (EDT)
commit00cf95efa77772b44e09cf734e70c2ef24a56867 (patch)
tree9e83da80f8a224b0d9f103316bbc32b942d4a2f6
parent001f71d907b067275bfbd034572fae27f1fc1a96 (diff)
downloadcdo-00cf95efa77772b44e09cf734e70c2ef24a56867.zip
cdo-00cf95efa77772b44e09cf734e70c2ef24a56867.tar.gz
cdo-00cf95efa77772b44e09cf734e70c2ef24a56867.tar.bz2
[202833] Horizontal Mapping Strategy
https://bugs.eclipse.org/bugs/show_bug.cgi?id=202833
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMapping.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java32
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java32
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoMapping.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java156
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java27
11 files changed, 175 insertions, 116 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 2e6eefa..9d886ac 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
@@ -30,9 +30,11 @@ public interface IMapping
public void writeRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
+ public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int referenceChunk);
- public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp);
+ public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp,
+ int referenceChunk);
- public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version);
+ public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version,
+ int referenceChunk);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
index 2d3e9de..6d3aeca 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
@@ -31,7 +31,7 @@ public interface IReferenceMapping
public void writeReference(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
- public void readReference(IDBStoreAccessor storeAccessor, CDORevisionImpl revision);
+ public void readReference(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int referenceChunk);
public void readChunks(IDBStoreChunkReader chunkReader, List<Chunk> chunks, String string);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
index adf81f2..fac3f8e 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
@@ -133,6 +133,38 @@ public class CDODBSchema extends DBSchema
public static final IDBIndex INDEX_FEATURES_PK = //
FEATURES.addIndex(IDBIndex.Type.PRIMARY_KEY, FEATURES_ID);
+ /**
+ * Field names of attribute tables
+ */
+ public static final String ATTRIBUTES_ID = "cdo_id";
+
+ public static final String ATTRIBUTES_VERSION = "cdo_version";
+
+ public static final String ATTRIBUTES_CLASS = "cdo_class";
+
+ public static final String ATTRIBUTES_CREATED = "cdo_created";
+
+ public static final String ATTRIBUTES_REVISED = "cdo_revised";
+
+ public static final String ATTRIBUTES_RESOURCE = "cdo_resource";
+
+ public static final String ATTRIBUTES_CONTAINER = "cdo_container";
+
+ public static final String ATTRIBUTES_FEATURE = "cdo_feature";
+
+ /**
+ * Field names of reference tables
+ */
+ public static final String REFERENCES_FEATURE = "cdo_feature";
+
+ public static final String REFERENCES_SOURCE = "cdo_source";
+
+ public static final String REFERENCES_VERSION = "cdo_version";
+
+ public static final String REFERENCES_IDX = "cdo_idx";
+
+ public static final String REFERENCES_TARGET = "cdo_target";
+
private CDODBSchema()
{
super("CDO");
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 c8ed97b..f903571 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
@@ -430,7 +430,7 @@ public class DBStoreAccessor implements IDBStoreAccessor
CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
IMapping mapping = ClassServerInfo.getMapping(cdoClass);
- mapping.readRevision(this, revision);
+ mapping.readRevision(this, revision, referenceChunk);
return revision;
}
@@ -446,7 +446,7 @@ public class DBStoreAccessor implements IDBStoreAccessor
CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
IMapping mapping = ClassServerInfo.getMapping(cdoClass);
- mapping.readRevisionByTime(this, revision, timeStamp);
+ mapping.readRevisionByTime(this, revision, timeStamp, referenceChunk);
return revision;
}
@@ -462,7 +462,7 @@ public class DBStoreAccessor implements IDBStoreAccessor
CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
IMapping mapping = ClassServerInfo.getMapping(cdoClass);
- mapping.readRevisionByVersion(this, revision, version);
+ mapping.readRevisionByVersion(this, revision, version, referenceChunk);
return revision;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java
index 8629ef3..610a9c4 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java
@@ -60,7 +60,7 @@ public class DBStoreChunkReader extends StoreChunkReader implements IDBStoreChun
{
super.addSimpleChunk(index);
builder.append(" AND ");
- builder.append(ReferenceMapping.FIELD_NAME_IDX);
+ builder.append(CDODBSchema.REFERENCES_IDX);
builder.append("=");
builder.append(index);
}
@@ -70,7 +70,7 @@ public class DBStoreChunkReader extends StoreChunkReader implements IDBStoreChun
{
super.addRangedChunk(fromIndex, toIndex);
builder.append(" AND ");
- builder.append(ReferenceMapping.FIELD_NAME_IDX);
+ builder.append(CDODBSchema.REFERENCES_IDX);
builder.append(" BETWEEN ");
builder.append(fromIndex);
builder.append(" AND ");
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
index 567156a..266ccda 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
@@ -37,22 +37,6 @@ import java.util.Set;
*/
public abstract class Mapping implements IMapping
{
- public static final String FIELD_NAME_ID = "cdo_id";
-
- public static final String FIELD_NAME_VERSION = "cdo_version";
-
- public static final String FIELD_NAME_CLASS = "cdo_class";
-
- public static final String FIELD_NAME_CREATED = "cdo_created";
-
- public static final String FIELD_NAME_REVISED = "cdo_revised";
-
- public static final String FIELD_NAME_RESOURCE = "cdo_resource";
-
- public static final String FIELD_NAME_CONTAINER = "cdo_container";
-
- public static final String FIELD_NAME_FEATURE = "cdo_feature";
-
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, Mapping.class);
private MappingStrategy mappingStrategy;
@@ -92,16 +76,16 @@ public abstract class Mapping implements IMapping
protected void initTable(IDBTable table, boolean full)
{
- table.addField(FIELD_NAME_ID, DBType.BIGINT);
- table.addField(FIELD_NAME_VERSION, DBType.INTEGER);
+ table.addField(CDODBSchema.ATTRIBUTES_ID, DBType.BIGINT);
+ table.addField(CDODBSchema.ATTRIBUTES_VERSION, DBType.INTEGER);
if (full)
{
- table.addField(FIELD_NAME_CLASS, DBType.INTEGER);
- table.addField(FIELD_NAME_CREATED, DBType.BIGINT);
- table.addField(FIELD_NAME_REVISED, DBType.BIGINT);
- table.addField(FIELD_NAME_RESOURCE, DBType.BIGINT);
- table.addField(FIELD_NAME_CONTAINER, DBType.BIGINT);
- table.addField(FIELD_NAME_FEATURE, DBType.INTEGER);
+ table.addField(CDODBSchema.ATTRIBUTES_CLASS, DBType.INTEGER);
+ table.addField(CDODBSchema.ATTRIBUTES_CREATED, DBType.BIGINT);
+ table.addField(CDODBSchema.ATTRIBUTES_REVISED, DBType.BIGINT);
+ table.addField(CDODBSchema.ATTRIBUTES_RESOURCE, DBType.BIGINT);
+ table.addField(CDODBSchema.ATTRIBUTES_CONTAINER, DBType.BIGINT);
+ table.addField(CDODBSchema.ATTRIBUTES_FEATURE, DBType.INTEGER);
}
}
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 778cea7..c4f6c81 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
@@ -159,11 +159,11 @@ public abstract class MappingStrategy implements IMappingStrategy
{
StringBuilder builder = new StringBuilder();
builder.append("SELECT DISTINCT ");
- builder.append(Mapping.FIELD_NAME_ID);
+ builder.append(CDODBSchema.ATTRIBUTES_ID);
if (withTypes)
{
builder.append(", ");
- builder.append(Mapping.FIELD_NAME_CLASS);
+ builder.append(CDODBSchema.ATTRIBUTES_CLASS);
}
builder.append(" FROM ");
@@ -189,8 +189,8 @@ public abstract class MappingStrategy implements IMappingStrategy
public CDOClassRef readObjectType(IDBStoreAccessor storeAccessor, CDOID id)
{
- String prefix = "SELECT DISTINCT " + Mapping.FIELD_NAME_CLASS + " FROM ";
- String suffix = " WHERE " + Mapping.FIELD_NAME_ID + "=" + id;
+ String prefix = "SELECT DISTINCT " + CDODBSchema.ATTRIBUTES_CLASS + " FROM ";
+ String suffix = " WHERE " + CDODBSchema.ATTRIBUTES_ID + "=" + id;
for (CDOClass cdoClass : getClassesWithObjectInfo())
{
ValueMapping mapping = (ValueMapping)ClassServerInfo.getMapping(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 e6163ec..51b22f5 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
@@ -51,15 +51,17 @@ public class NoMapping implements IMapping
{
}
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
+ public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int referenceChunk)
{
}
- public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp,
+ int referenceChunk)
{
}
- public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version)
+ public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version,
+ int referenceChunk)
{
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
index bb6601f..0b74be3 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
@@ -11,11 +11,13 @@ import org.eclipse.emf.cdo.server.IStoreChunkReader.Chunk;
import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IDBStoreChunkReader;
import org.eclipse.emf.cdo.server.db.IReferenceMapping;
+import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBTable;
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -27,15 +29,9 @@ import java.util.Map;
*/
public class ReferenceMapping extends FeatureMapping implements IReferenceMapping
{
- public static final String FIELD_NAME_FEATURE = "cdo_feature";
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, ReferenceMapping.class);
- public static final String FIELD_NAME_SOURCE = "cdo_source";
-
- public static final String FIELD_NAME_VERSION = "cdo_version";
-
- public static final String FIELD_NAME_IDX = "cdo_idx";
-
- public static final String FIELD_NAME_TARGET = "cdo_target";
+ private static final String SELECT_SUFFIX = " ORDER BY " + CDODBSchema.REFERENCES_IDX;
private IDBTable table;
@@ -43,7 +39,9 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
private boolean withFeature;
- private String constantPrefix;
+ private String insertPrefix;
+
+ private String selectPrefix;
public ReferenceMapping(ValueMapping valueMapping, CDOFeature feature, ToMany toMany)
{
@@ -51,18 +49,9 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
this.toMany = toMany;
mapReference(valueMapping.getCDOClass(), feature);
- // Build the constant SQL prefix
- StringBuilder builder = new StringBuilder();
- builder.append("INSERT INTO ");
- builder.append(table);
- builder.append(" VALUES (");
- if (withFeature)
- {
- builder.append(FeatureServerInfo.getDBID(feature));
- builder.append(", ");
- }
-
- constantPrefix = builder.toString();
+ int dbFeatureID = withFeature ? FeatureServerInfo.getDBID(getFeature()) : 0;
+ insertPrefix = createInsertPrefix(dbFeatureID);
+ selectPrefix = createSelectPrefix(dbFeatureID);
}
public IDBTable getTable()
@@ -78,7 +67,7 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
for (Object element : revision.getList(getFeature()))
{
long target = ((CDOID)element).getValue();
- StringBuilder builder = new StringBuilder(constantPrefix);
+ StringBuilder builder = new StringBuilder(insertPrefix);
builder.append(source);
builder.append(", ");
builder.append(version);
@@ -87,14 +76,37 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
builder.append(", ");
builder.append(target);
builder.append(")");
- getValueMapping().sqlUpdate(storeAccessor, builder.toString());
+ String sql = builder.toString();
+ getValueMapping().sqlUpdate(storeAccessor, sql);
}
}
- public void readReference(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
+ public void readReference(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int referenceChunk)
{
- // TODO Implement method ReferenceMapping.readReference()
- throw new UnsupportedOperationException("Not yet implemented");
+ CDOID source = revision.getID();
+ int version = revision.getVersion();
+ String where = "";
+
+ String sql = createSelect(source, version, where);
+ if (TRACER.isEnabled()) TRACER.trace(sql);
+ ResultSet resultSet = null;
+
+ try
+ {
+ resultSet = storeAccessor.getStatement().executeQuery(sql);
+ while (resultSet.next())
+ {
+ long target = resultSet.getLong(1);
+ }
+ }
+ catch (SQLException ex)
+ {
+ throw new DBException(ex);
+ }
+ finally
+ {
+ DBUtil.close(resultSet);
+ }
}
public void readChunks(IDBStoreChunkReader chunkReader, List<Chunk> chunks, String where)
@@ -102,34 +114,9 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
IDBStoreAccessor storeAccessor = chunkReader.getStoreAccessor();
CDOID source = chunkReader.getRevision().getID();
int version = chunkReader.getRevision().getVersion();
- CDOFeature feature = chunkReader.getFeature();
-
- StringBuilder builder = new StringBuilder();
- builder.append("SELECT ");
- builder.append(FIELD_NAME_TARGET);
- builder.append(" FROM ");
- builder.append(table);
- builder.append(" WHERE ");
- if (withFeature)
- {
- builder.append(FIELD_NAME_FEATURE);
- builder.append("=");
- builder.append(FeatureServerInfo.getDBID(feature));
- }
- builder.append(" AND ");
- builder.append(FIELD_NAME_SOURCE);
- builder.append("=");
- builder.append(source.getValue());
- builder.append(" AND ");
- builder.append(FIELD_NAME_VERSION);
- builder.append("=");
- builder.append(version);
- builder.append(where);
- builder.append(" ORDER BY ");
- builder.append(FIELD_NAME_IDX);
-
- String sql = builder.toString();
+ String sql = createSelect(source, version, where);
+ if (TRACER.isEnabled()) TRACER.trace(sql);
ResultSet resultSet = null;
try
@@ -167,6 +154,59 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
}
}
+ protected String createInsertPrefix(int dbFeatureID)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("INSERT INTO ");
+ builder.append(table);
+ builder.append(" VALUES (");
+ if (dbFeatureID != 0)
+ {
+ builder.append(FeatureServerInfo.getDBID(getFeature()));
+ builder.append(", ");
+ }
+
+ return builder.toString();
+ }
+
+ protected String createSelectPrefix(int dbFeatureID)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SELECT ");
+ builder.append(CDODBSchema.REFERENCES_TARGET);
+ builder.append(" FROM ");
+ builder.append(table);
+ builder.append(" WHERE ");
+ if (dbFeatureID != 0)
+ {
+ builder.append(CDODBSchema.REFERENCES_FEATURE);
+ builder.append("=");
+ builder.append(dbFeatureID);
+ builder.append(" AND ");
+ }
+
+ builder.append(CDODBSchema.REFERENCES_SOURCE);
+ builder.append("=");
+ return builder.toString();
+ }
+
+ protected String createSelect(CDOID source, int version, String where)
+ {
+ StringBuilder builder = new StringBuilder(selectPrefix);
+ builder.append(source.getValue());
+ builder.append(" AND ");
+ builder.append(CDODBSchema.REFERENCES_VERSION);
+ builder.append("=");
+ builder.append(version);
+ if (where != null)
+ {
+ builder.append(where);
+ }
+
+ builder.append(SELECT_SUFFIX);
+ return builder.toString();
+ }
+
protected void mapReference(CDOClass cdoClass, CDOFeature cdoFeature)
{
switch (toMany)
@@ -216,13 +256,13 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
IDBTable table = getValueMapping().addTable(tableName);
if (withFeature)
{
- table.addField(FIELD_NAME_FEATURE, DBType.INTEGER);
+ table.addField(CDODBSchema.REFERENCES_FEATURE, DBType.INTEGER);
}
- table.addField(FIELD_NAME_SOURCE, DBType.BIGINT);
- table.addField(FIELD_NAME_VERSION, DBType.INTEGER);
- table.addField(FIELD_NAME_IDX, DBType.INTEGER);
- table.addField(FIELD_NAME_TARGET, DBType.BIGINT);
+ table.addField(CDODBSchema.REFERENCES_SOURCE, DBType.BIGINT);
+ table.addField(CDODBSchema.REFERENCES_VERSION, DBType.INTEGER);
+ table.addField(CDODBSchema.REFERENCES_IDX, DBType.INTEGER);
+ table.addField(CDODBSchema.REFERENCES_TARGET, DBType.BIGINT);
return table;
}
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 4e2cd8d..7714b2c 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
@@ -42,19 +42,21 @@ public class RootMapping extends Mapping
sqlUpdate(storeAccessor, builder.toString());
}
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
+ public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int referenceChunk)
{
// TODO Implement method RootMapping.readRevision()
throw new UnsupportedOperationException("Not yet implemented");
}
- public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp,
+ int referenceChunk)
{
// TODO Implement method RootMapping.readRevisionByTime()
throw new UnsupportedOperationException("Not yet implemented");
}
- public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version)
+ public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version,
+ int referenceChunk)
{
// TODO Implement method RootMapping.readRevisionByVersion()
throw new UnsupportedOperationException("Not yet implemented");
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 1e7f8d9..79c3898 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
@@ -30,10 +30,10 @@ import java.util.List;
*/
public abstract class ValueMapping extends Mapping implements IValueMapping
{
- private static final long NO_TIMESTAMP = 0L;
-
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, ValueMapping.class);
+ private static final long NO_TIMESTAMP = 0L;
+
private List<IAttributeMapping> attributeMappings;
private List<IReferenceMapping> referenceMappings;
@@ -82,12 +82,13 @@ public abstract class ValueMapping extends Mapping implements IValueMapping
}
}
- public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
+ public void readRevision(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int referenceChunk)
{
- readRevisionByTime(storeAccessor, revision, NO_TIMESTAMP);
+ readRevisionByTime(storeAccessor, revision, NO_TIMESTAMP, referenceChunk);
}
- public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp)
+ public void readRevisionByTime(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, long timeStamp,
+ int referenceChunk)
{
if (attributeMappings != null)
{
@@ -96,11 +97,12 @@ public abstract class ValueMapping extends Mapping implements IValueMapping
if (referenceMappings != null)
{
- readReferences(storeAccessor, revision);
+ readReferences(storeAccessor, revision, referenceChunk);
}
}
- public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version)
+ public void readRevisionByVersion(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int version,
+ int referenceChunk)
{
// TODO Implement method ValueMapping.readRevisionByVersion()
throw new UnsupportedOperationException("Not yet implemented");
@@ -165,19 +167,14 @@ public abstract class ValueMapping extends Mapping implements IValueMapping
builder.append(")");
String sql = builder.toString();
-
- if (TRACER.isEnabled())
- {
- TRACER.trace(sql);
- }
-
+ if (TRACER.isEnabled()) TRACER.trace(sql);
}
- protected void readReferences(IDBStoreAccessor storeAccessor, CDORevisionImpl revision)
+ protected void readReferences(IDBStoreAccessor storeAccessor, CDORevisionImpl revision, int referenceChunk)
{
for (IReferenceMapping referenceMapping : referenceMappings)
{
- referenceMapping.readReference(storeAccessor, revision);
+ referenceMapping.readReference(storeAccessor, revision, referenceChunk);
}
}