Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-02-21 09:46:19 +0000
committerEike Stepper2011-02-21 09:46:19 +0000
commit01e7412248e0999ce09c9f5ddd54bb427f984cd9 (patch)
tree14977f7aa4f1b28284ff96d96c8d19cfdccf706e /plugins/org.eclipse.emf.cdo.server.mongodb
parentfda4f004599712fc78b9afdd1f3cb61174091f60 (diff)
downloadcdo-01e7412248e0999ce09c9f5ddd54bb427f984cd9.tar.gz
cdo-01e7412248e0999ce09c9f5ddd54bb427f984cd9.tar.xz
cdo-01e7412248e0999ce09c9f5ddd54bb427f984cd9.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')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java6
2 files changed, 5 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
index 1a01ab9bea..6211d32199 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
@@ -670,7 +670,7 @@ public class Commits extends Coll
idHandler.write(query, REVISIONS + "." + REVISIONS_ID, id);
int version = branchVersion.getVersion();
- query.put(REVISIONS + "." + REVISIONS_VERSION, version);
+ query.put(REVISIONS + "." + REVISIONS_VERSION, new BasicDBObject("$in", new int[] { version, -version }));
final CDOBranch branch = branchVersion.getBranch();
if (store.isBranching())
@@ -689,17 +689,6 @@ public class Commits extends Coll
return null;
}
- int revisionBranch = CDOBranch.MAIN_BRANCH_ID;
- if (store.isBranching())
- {
- revisionBranch = (Integer)doc.get(COMMITS_BRANCH);
- }
-
- if (branch.getID() != revisionBranch)
- {
- return null;
- }
-
long revisionTime = (Long)doc.get(COMMITS_ID);
CDOBranchPoint branchPoint = branch.getPoint(revisionTime);
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 0f4f67889d..6bd3a5ce4f 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
@@ -113,7 +113,8 @@ public class MongoDBBrowserPage extends AbstractPage
for (DBObject index : coll.getIndexInfo())
{
++i;
- pout.print("<tr><td valign=\"top\">" + i + "</td><td valign=\"top\">");
+ String bg = (i & 1) == 1 ? "bgcolor=\"DDDDDD\"" : "bgcolor=\"EEEEEE\"";
+ pout.print("<tr><td valign=\"top\" " + bg + "><b>" + i + "&nbsp;</b></td><td valign=\"top\">");
showObject(browser, pout, index, "");
pout.print("</td></tr>\r\n");
}
@@ -149,7 +150,8 @@ public class MongoDBBrowserPage extends AbstractPage
continue;
}
- pout.print("<tr><td valign=\"top\">" + i + "</td><td valign=\"top\">");
+ String bg = (i & 1) == 1 ? "bgcolor=\"DDDDDD\"" : "bgcolor=\"EEEEEE\"";
+ pout.print("<tr><td valign=\"top\" " + bg + "><b>" + i + "&nbsp;</b></td><td valign=\"top\">");
showObject(browser, pout, doc, "");
pout.print("</td></tr>\r\n");
}

Back to the top