summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-31 11:34:43 (EST)
committerEike Stepper2008-01-31 11:34:43 (EST)
commit904f18144ce187fb17aa3d8ba9db9ed42c20acce (patch)
tree6c48d0d05abbf4abdfe4d2e1ddc882bf901e41a2
parentb760cd44cd370bbf9249177d95191808e44936fa (diff)
downloadcdo-904f18144ce187fb17aa3d8ba9db9ed42c20acce.zip
cdo-904f18144ce187fb17aa3d8ba9db9ed42c20acce.tar.gz
cdo-904f18144ce187fb17aa3d8ba9db9ed42c20acce.tar.bz2
[217117] Develop a HibernateStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=217117
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java70
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java6
2 files changed, 36 insertions, 40 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java
index caa56bc..aeba898 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java
@@ -17,13 +17,10 @@ import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IView;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
/**
* @author Simon McDuff
@@ -32,39 +29,40 @@ public class MEMStore extends Store
{
public static final String TYPE = "mem";
- private Map<CDOID, List<CDORevision>> revisions = new HashMap<CDOID, List<CDORevision>>()
- {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String toString()
- {
- List<Entry<CDOID, List<CDORevision>>> entries = new ArrayList<Entry<CDOID, List<CDORevision>>>(entrySet());
- Collections.sort(entries, new Comparator<Entry<CDOID, List<CDORevision>>>()
- {
- public int compare(Entry<CDOID, List<CDORevision>> o1, Entry<CDOID, List<CDORevision>> o2)
- {
- return o1.getKey().compareTo(o2.getKey());
- }
- });
-
- StringBuilder builder = new StringBuilder();
- for (Entry<CDOID, List<CDORevision>> entry : entries)
- {
- builder.append(entry.getKey());
- builder.append(" -->");
- for (CDORevision revision : entry.getValue())
- {
- builder.append(" ");
- builder.append(revision);
- }
-
- builder.append("\n");
- }
-
- return builder.toString();
- }
- };
+ private Map<CDOID, List<CDORevision>> revisions = new HashMap<CDOID, List<CDORevision>>();
+
+ // {
+ // private static final long serialVersionUID = 1L;
+ //
+ // @Override
+ // public String toString()
+ // {
+ // List<Entry<CDOID, List<CDORevision>>> entries = new ArrayList<Entry<CDOID, List<CDORevision>>>(entrySet());
+ // Collections.sort(entries, new Comparator<Entry<CDOID, List<CDORevision>>>()
+ // {
+ // public int compare(Entry<CDOID, List<CDORevision>> o1, Entry<CDOID, List<CDORevision>> o2)
+ // {
+ // return o1.getKey().compareTo(o2.getKey());
+ // }
+ // });
+ //
+ // StringBuilder builder = new StringBuilder();
+ // for (Entry<CDOID, List<CDORevision>> entry : entries)
+ // {
+ // builder.append(entry.getKey());
+ // builder.append(" -->");
+ // for (CDORevision revision : entry.getValue())
+ // {
+ // builder.append(" ");
+ // builder.append(revision);
+ // }
+ //
+ // builder.append("\n");
+ // }
+ //
+ // return builder.toString();
+ // }
+ // };
public MEMStore()
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index 263fda2..79183cb 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -27,7 +27,6 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.emf.cdo.protocol.id.CDOIDProvider;
-import org.eclipse.emf.cdo.protocol.id.CDOIDTyped;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver;
@@ -398,10 +397,9 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return type;
}
- if (id instanceof CDOIDTyped)
+ CDOClassRef typeRef = id.getType();
+ if (typeRef != null)
{
- CDOIDTyped typed = (CDOIDTyped)id;
- CDOClassRef typeRef = typed.getType();
type = (CDOClassImpl)typeRef.resolve(session.getPackageManager());
session.registerObjectType(id, type);
return type;