summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-24 05:07:27 (EDT)
committerEike Stepper2007-08-24 05:07:27 (EDT)
commitfb6598aefaeb7c1c6d1e55558090293c84da0066 (patch)
treed9ae96bdb763c059036013865564c54f9006db9e
parent9a2b24ee2068239051edeca0e5c5b39df168acf6 (diff)
downloadcdo-fb6598aefaeb7c1c6d1e55558090293c84da0066.zip
cdo-fb6598aefaeb7c1c6d1e55558090293c84da0066.tar.gz
cdo-fb6598aefaeb7c1c6d1e55558090293c84da0066.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/RootMapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ValueMapping.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java6
5 files changed, 36 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java
index 3212813..801fd50 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMapping.java
@@ -28,4 +28,10 @@ public class HorizontalMapping extends ValueMapping
{
return (HorizontalMappingStrategy)super.getMappingStrategy();
}
+
+ @Override
+ protected boolean hasFullRevisionInfo()
+ {
+ return true;
+ }
}
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 1e987f0..74ec5ea 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
@@ -74,21 +74,26 @@ public abstract class Mapping implements IMapping
return affectedTables;
}
- protected void appendFullInfo(StringBuilder builder, CDORevisionImpl revision)
+ protected void appendRevisionInfo(StringBuilder builder, CDORevisionImpl revision, boolean full)
{
- builder.append(ServerInfo.getDBID(revision.getCDOClass()));
- builder.append(", ");
- builder.append(revision.getVersion());
- builder.append(", ");
- builder.append(new Date(revision.getCreated()));
- builder.append(", ");
- builder.append(new Date(revision.getRevised()));
- builder.append(", ");
- builder.append(revision.getResourceID().getValue());
- builder.append(", ");
- builder.append(revision.getContainerID().getValue());
- builder.append(", ");
- builder.append(revision.getContainingFeatureID());
+ builder.append(revision.getID().getValue());
+ if (full)
+ {
+ builder.append(", ");
+ builder.append(ServerInfo.getDBID(revision.getCDOClass()));
+ builder.append(", ");
+ builder.append(revision.getVersion());
+ builder.append(", ");
+ builder.append(new Date(revision.getCreated()));
+ builder.append(", ");
+ builder.append(new Date(revision.getRevised()));
+ builder.append(", ");
+ builder.append(revision.getResourceID().getValue());
+ builder.append(", ");
+ builder.append(revision.getContainerID().getValue());
+ builder.append(", ");
+ builder.append(revision.getContainingFeatureID());
+ }
}
protected void executeSQL(IDBStoreAccessor storeAccessor, String sql) throws DBException
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 86a6eda..f51da87 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
@@ -31,9 +31,7 @@ public class RootMapping extends Mapping
builder.append("INSERT INTO ");
builder.append(getTable());
builder.append(" VALUES (");
- builder.append(revision.getID().getValue());
- builder.append(", ");
- appendFullInfo(builder, revision);
+ appendRevisionInfo(builder, revision, true);
builder.append(")");
executeSQL(storeAccessor, builder.toString());
}
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 9df7fc0..97fdfc9 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
@@ -23,7 +23,7 @@ import java.util.List;
/**
* @author Eike Stepper
*/
-public class ValueMapping extends Mapping
+public abstract class ValueMapping extends Mapping
{
private List<IAttributeMapping> attributeMappings;
@@ -65,9 +65,7 @@ public class ValueMapping extends Mapping
builder.append("INSERT INTO ");
builder.append(getTable());
builder.append(" VALUES (");
- builder.append(revision.getID().getValue());
- builder.append(", ");
- appendFullInfo(builder, revision);
+ appendRevisionInfo(builder, revision, hasFullRevisionInfo());
builder.append(", ");
for (IAttributeMapping attributeMapping : attributeMappings)
@@ -87,4 +85,6 @@ public class ValueMapping extends Mapping
referenceMapping.writeReference(this, storeAccessor, revision);
}
}
+
+ protected abstract boolean hasFullRevisionInfo();
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java
index a6c49a3..0bf3600 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMapping.java
@@ -50,6 +50,12 @@ public class VerticalMapping extends ValueMapping
return (VerticalMappingStrategy)super.getMappingStrategy();
}
+ @Override
+ protected boolean hasFullRevisionInfo()
+ {
+ return false;
+ }
+
public List<IMapping> getSuperMappings()
{
return superMappings;