summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-25 02:41:13 (EDT)
committerEike Stepper2007-08-25 02:41:13 (EDT)
commitb73f865ea45713ccdb12baf6e04a5e89fd8b62a0 (patch)
tree6ed56114e38e714de3f3e4263af807cd9b7a4009
parent6cec9f82bb01a87fd78bdeebff6043e21970b8fe (diff)
downloadcdo-b73f865ea45713ccdb12baf6e04a5e89fd8b62a0.zip
cdo-b73f865ea45713ccdb12baf6e04a5e89fd8b62a0.tar.gz
cdo-b73f865ea45713ccdb12baf6e04a5e89fd8b62a0.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IMappingStrategy.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java6
7 files changed, 38 insertions, 25 deletions
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 0d7a8e9..58bb358 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
@@ -21,6 +21,12 @@ public interface IMappingStrategy
{
public String getType();
+ /**
+ * @return <code>true</code> if this mapping strategy supports the efficient
+ * lookup of object types, <code>false</code> otherwise.
+ */
+ public boolean hasEfficientTypeLookup();
+
public IDBStore getStore();
public void setStore(IDBStore store);
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 b46316a..01a253a 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
@@ -99,6 +99,11 @@ public class DBStore extends Store implements IDBStore
return false;
}
+ public boolean hasEfficientTypeLookup()
+ {
+ return mappingStrategy.hasEfficientTypeLookup();
+ }
+
public DBStoreAccessor getReader(ISession session) throws DBException
{
return new DBStoreAccessor(this, session);
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 659bc18..669884d 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
@@ -27,6 +27,11 @@ public class HorizontalMappingStrategy extends MappingStrategy
return "horizontal";
}
+ public boolean hasEfficientTypeLookup()
+ {
+ return false;
+ }
+
@Override
protected IMapping createMapping(CDOClass cdoClass)
{
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 f4e3f16..3b6d3dd 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
@@ -87,31 +87,16 @@ public abstract class Mapping implements IMapping
}
}
- @Deprecated
- protected void appendRevisionFields(StringBuilder builder, CDORevisionImpl revision, boolean full)
- {
- IDBField[] fields = table.getFields();
- builder.append(fields[0].getName());
- if (full)
- {
- for (int i = 1; i < 8; i++)
- {
- builder.append(", ");
- builder.append(fields[i].getName());
- }
- }
- }
-
protected void appendRevisionInfos(StringBuilder builder, CDORevisionImpl revision, boolean full)
{
builder.append(revision.getID().getValue());
+ builder.append(", ");
+ builder.append(revision.getVersion());
if (full)
{
builder.append(", ");
builder.append(ServerInfo.getDBID(revision.getCDOClass()));
builder.append(", ");
- builder.append(revision.getVersion());
- builder.append(", ");
builder.append(revision.getCreated());
builder.append(", ");
builder.append(revision.getRevised());
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 bdcf804..aac3ba4 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
@@ -12,7 +12,6 @@ import org.eclipse.emf.cdo.server.db.IReferenceMapping;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.IDBTable;
-import java.util.List;
import java.util.Map;
/**
@@ -57,16 +56,17 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
{
int idx = 0;
long source = revision.getID().getValue();
- CDOFeature feature = getFeature();
- List list = revision.getList(feature);
- for (Object value : list)
+ int version = revision.getVersion();
+ for (Object element : revision.getList(getFeature()))
{
- long target = ((CDOID)value).getValue();
+ long target = ((CDOID)element).getValue();
StringBuilder builder = new StringBuilder(constantPrefix);
- builder.append(idx++);
- builder.append(", ");
builder.append(source);
builder.append(", ");
+ builder.append(version);
+ builder.append(", ");
+ builder.append(idx++);
+ builder.append(", ");
builder.append(target);
builder.append(")");
getValueMapping().sqlUpdate(storeAccessor, builder.toString());
@@ -125,8 +125,9 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
table.addField("cdo_feature", DBType.INTEGER);
}
- table.addField("cdo_idx", DBType.INTEGER);
table.addField("cdo_source", DBType.BIGINT);
+ table.addField("cdo_version", DBType.INTEGER);
+ table.addField("cdo_idx", DBType.INTEGER);
table.addField("cdo_target", DBType.BIGINT);
return table;
}
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 f3034f9..e5155c0 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
@@ -30,6 +30,11 @@ public class VerticalMappingStrategy extends MappingStrategy
return "vertical";
}
+ public boolean hasEfficientTypeLookup()
+ {
+ return true;
+ }
+
public RootMapping getRootMapping()
{
if (rootMapping == null)
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 6a4b8e8..63c004b 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
@@ -35,6 +35,12 @@ public interface IStore extends IRepositoryElement
public boolean hasBranchingSupport();
/**
+ * @return <code>true</code> if this store supports the efficient lookup of
+ * object types, <code>false</code> otherwise.
+ */
+ public boolean hasEfficientTypeLookup();
+
+ /**
* Returns a reader that can be used to read from this store in the context of
* the given session.
*