Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-02-17 07:45:31 +0000
committerEike Stepper2011-02-17 07:45:31 +0000
commit64fe8e0918c52f66279ab34ccd0cf8a26773c899 (patch)
tree359d08b01f6647bbeb1d650ec3eab8ba5013ae24 /plugins/org.eclipse.emf.cdo.server.mongodb/src
parente080f01452962b9214fd8ada08c02a95138dec63 (diff)
downloadcdo-64fe8e0918c52f66279ab34ccd0cf8a26773c899.tar.gz
cdo-64fe8e0918c52f66279ab34ccd0cf8a26773c899.tar.xz
cdo-64fe8e0918c52f66279ab34ccd0cf8a26773c899.zip
[337152] [Mongo] Create a MongoDBStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337152
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.mongodb/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreAccessor.java28
2 files changed, 28 insertions, 15 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
index 8042ec4875..2e3e34fbdf 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
@@ -144,10 +144,19 @@ public class MongoDBBrowserPage extends AbstractPage
}
else
{
+ pout.print("<font color=\"#0000FF\">");
+ if (value instanceof String)
+ {
+ pout.print("\"");
+ }
+
pout.print(value);
- pout.print("<em>&nbsp;&nbsp;(");
- pout.print(value.getClass().getSimpleName().toLowerCase());
- pout.print(")</em><br>");
+ if (value instanceof String)
+ {
+ pout.print("\"");
+ }
+
+ pout.print("</font><br>");
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreAccessor.java
index 6dbcdc246a..b470a4d9b8 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreAccessor.java
@@ -395,37 +395,41 @@ public class MongoDBStoreAccessor extends StoreAccessorBase implements IMongoDBS
IDHandler idHandler = getStore().getIDHandler();
DBObject doc = new BasicDBObject();
- idHandler.write(doc, "_cdoid", revision.getID());
+ idHandler.write(doc, "cdo_id", revision.getID());
if (getStore().getRepository().isSupportingBranches())
{
- doc.put("_branch", revision.getBranch().getID());
+ int branch = revision.getBranch().getID();
+ if (branch != 0)
+ {
+ doc.put("cdo_branch", branch);
+ }
}
- // doc.put("_version", revision.getVersion());
- // doc.put("_created", revision.getTimeStamp());
+ doc.put("cdo_version", revision.getVersion());
+ doc.put("cdo_created", revision.getTimeStamp());
long revised = revision.getRevised();
if (revised != CDOBranchPoint.UNSPECIFIED_DATE)
{
- doc.put("_revised", revised);
+ doc.put("cdo_revised", revised);
}
- doc.put("_class", new CDOClassifierRef(revision.getEClass()).getURI());
+ doc.put("cdo_class", new CDOClassifierRef(revision.getEClass()).getURI());
CDOID resourceID = revision.getResourceID();
if (!CDOIDUtil.isNull(resourceID))
{
- idHandler.write(doc, "_resource", resourceID);
+ idHandler.write(doc, "cdo_resource", resourceID);
}
CDOID containerID = (CDOID)revision.getContainerID();
if (!CDOIDUtil.isNull(containerID))
{
- idHandler.write(doc, "_container", containerID);
+ idHandler.write(doc, "cdo_container", containerID);
int featureID = revision.getContainingFeatureID();
if (featureID != 0)
{
- doc.put("_feature", featureID);
+ doc.put("cdo_feature", featureID);
}
}
@@ -449,13 +453,13 @@ public class MongoDBStoreAccessor extends StoreAccessorBase implements IMongoDBS
IDHandler idHandler = getStore().getIDHandler();
DBObject doc = new BasicDBObject();
- idHandler.write(doc, "_cdoid", revisionDelta.getID());
+ idHandler.write(doc, "cdo_id", revisionDelta.getID());
if (getStore().getRepository().isSupportingBranches())
{
- doc.put("_branch", revisionDelta.getBranch().getID());
+ doc.put("cdo_branch", revisionDelta.getBranch().getID());
}
- // doc.put("_version", revisionDelta.getVersion());
+ // doc.put("cdo_version", revisionDelta.getVersion());
return doc;
}

Back to the top