Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-02-20 14:00:52 +0000
committerEike Stepper2011-02-20 14:00:52 +0000
commit112c7936f36dc31a230348b680006bcc16383cf5 (patch)
treeeb5bb57f0f6fcf9a52002529b2b9410074408651 /plugins/org.eclipse.emf.cdo.server.mongodb
parent028808a21ca73b7ce92ce141080a0ee019620345 (diff)
downloadcdo-112c7936f36dc31a230348b680006bcc16383cf5.tar.gz
cdo-112c7936f36dc31a230348b680006bcc16383cf5.tar.xz
cdo-112c7936f36dc31a230348b680006bcc16383cf5.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/MongoDBStore.java41
1 files changed, 23 insertions, 18 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java
index aad6d35f4e..c40c8a5aa6 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStore.java
@@ -316,23 +316,23 @@ public class MongoDBStore extends Store implements IMongoDBStore, //
@Override
public Object toMongo(Object value)
{
- if (value != null)
+ if (value == null)
{
- return idHandler.toValue((CDOID)value);
+ return null;
}
- return null;
+ return idHandler.toValue((CDOID)value);
}
@Override
public Object fromMongo(Object value)
{
- if (value != null)
+ if (value == null)
{
- return idHandler.fromValue(value);
+ return null;
}
- return null;
+ return idHandler.fromValue(value);
}
});
@@ -341,6 +341,11 @@ public class MongoDBStore extends Store implements IMongoDBStore, //
@Override
public Object toMongo(Object value)
{
+ if (value == null)
+ {
+ return null;
+ }
+
return Character.toString((Character)value);
}
@@ -417,23 +422,23 @@ public class MongoDBStore extends Store implements IMongoDBStore, //
@Override
public Object toMongo(Object value)
{
- if (value != null)
+ if (value == null)
{
- return ((BigDecimal)value).toPlainString();
+ return null;
}
- return null;
+ return ((BigDecimal)value).toPlainString();
}
@Override
public Object fromMongo(Object value)
{
- if (value != null)
+ if (value == null)
{
- return new BigDecimal((String)value);
+ return null;
}
- return null;
+ return new BigDecimal((String)value);
}
});
@@ -442,23 +447,23 @@ public class MongoDBStore extends Store implements IMongoDBStore, //
@Override
public Object toMongo(Object value)
{
- if (value != null)
+ if (value == null)
{
- return ((BigInteger)value).toString();
+ return null;
}
- return null;
+ return ((BigInteger)value).toString();
}
@Override
public Object fromMongo(Object value)
{
- if (value != null)
+ if (value == null)
{
- return new BigInteger((String)value);
+ return null;
}
- return null;
+ return new BigInteger((String)value);
}
});
}

Back to the top