summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-02-25 11:37:26 (EST)
committerEike Stepper2008-02-25 11:37:26 (EST)
commit97434d704a5dc40a1f7631b37e9a9abc60e1110a (patch)
tree4600abf24d3a5921bf36a675edc589ec9da8fdf3
parent893709d5ffb6401033aa74a3ed95587aa83d56ca (diff)
downloadcdo-97434d704a5dc40a1f7631b37e9a9abc60e1110a.zip
cdo-97434d704a5dc40a1f7631b37e9a9abc60e1110a.tar.gz
cdo-97434d704a5dc40a1f7631b37e9a9abc60e1110a.tar.bz2
[217117] Develop a HibernateStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=217117
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManagerImpl.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java58
9 files changed, 40 insertions, 57 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
index eb6af45..2a3133d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
@@ -15,7 +15,6 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.tests.model1.Model1Factory;
@@ -119,14 +118,14 @@ public class FetchRuleAnalyzerTest extends AbstractCDOTest
assertEquals(2, fetchRules.size());
CDOFetchRule fetchRule1 = fetchRules.get(0);
- EClass eClass = ModelUtil.getEClass((CDOClassImpl)fetchRule1.getCDOClass(), session.getPackageRegistry());
+ EClass eClass = ModelUtil.getEClass(fetchRule1.getCDOClass(), session.getPackageRegistry());
assertEquals(Model1Package.eINSTANCE.getCompany(), eClass);
assertEquals(1, fetchRule1.getFeatures().size());
assertEquals(Model1Package.eINSTANCE.getCompany_PurchaseOrders().getName(), fetchRule1.getFeatures().get(0)
.getName());
CDOFetchRule fetchRule2 = fetchRules.get(1);
- EClass ePurchaseOrder = ModelUtil.getEClass((CDOClassImpl)fetchRule2.getCDOClass(), session.getPackageRegistry());
+ EClass ePurchaseOrder = ModelUtil.getEClass(fetchRule2.getCDOClass(), session.getPackageRegistry());
assertEquals(Model1Package.eINSTANCE.getPurchaseOrder(), ePurchaseOrder);
assertEquals(1, fetchRule2.getFeatures().size());
assertEquals(Model1Package.eINSTANCE.getPurchaseOrder_Supplier().getName(), fetchRule2.getFeatures().get(0)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
index 2ab2626..79b7fb0 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
@@ -14,7 +14,6 @@ package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.id.CDOID;
@@ -268,7 +267,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
}
// Handle values
- CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
+ CDOClass cdoClass = revision.getCDOClass();
CDOFeature[] features = cdoClass.getAllFeatures();
for (int i = 0; i < features.length; i++)
{
@@ -341,7 +340,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
transferContainmentToInstance(view);
// Handle values
- CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
+ CDOClass cdoClass = revision.getCDOClass();
CDOFeature[] features = cdoClass.getAllFeatures();
for (CDOFeature feature : features)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
index 0b7f472..546d4c2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
+import org.eclipse.emf.cdo.internal.protocol.model.InternalCDOPackage;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.util.CDOPackageRegistry;
import org.eclipse.emf.cdo.util.EMFUtil;
@@ -83,7 +83,7 @@ public class CDOPackageRegistryImpl extends EPackageRegistryImpl implements CDOP
}
CDOPackage cdoPackage = ModelUtil.getCDOPackage(ePackage, session.getPackageManager());
- ((CDOPackageImpl)cdoPackage).setPersistent(!cdoPackage.getMetaIDRange().isTemporary());
+ ((InternalCDOPackage)cdoPackage).setPersistent(!cdoPackage.getMetaIDRange().isTemporary());
}
return super.put(key, value);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManagerImpl.java
index 6a0b11c..5053847 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManagerImpl.java
@@ -11,7 +11,6 @@
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOSessionPackageManager;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageManagerImpl;
import org.eclipse.emf.cdo.protocol.id.CDOIDMetaRange;
import org.eclipse.emf.cdo.protocol.id.CDOIDObjectFactory;
@@ -103,7 +102,7 @@ public class CDOSessionPackageManagerImpl extends CDOPackageManagerImpl implemen
}
@Override
- protected void resolve(CDOPackageImpl cdoPackage)
+ protected void resolve(CDOPackage cdoPackage)
{
if (!cdoPackage.isDynamic())
{
@@ -138,7 +137,7 @@ public class CDOSessionPackageManagerImpl extends CDOPackageManagerImpl implemen
}
@Override
- protected String provideEcore(CDOPackageImpl cdoPackage)
+ protected String provideEcore(CDOPackage cdoPackage)
{
EPackage ePackage = ModelUtil.getEPackage(cdoPackage, session.getPackageRegistry());
return EMFUtil.ePackageToString(ePackage);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index 3dcba3a..ad9540c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -19,7 +19,7 @@ import org.eclipse.emf.cdo.CDOTransactionHandler;
import org.eclipse.emf.cdo.CDOTransactionStartedEvent;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
+import org.eclipse.emf.cdo.internal.protocol.model.InternalCDOPackage;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.InternalCDORevisionDelta;
import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.emf.cdo.protocol.id.CDOIDTemp;
@@ -246,7 +246,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
for (CDOPackage newPackage : newPackages)
{
- ((CDOPackageImpl)newPackage).setPersistent(true);
+ ((InternalCDOPackage)newPackage).setPersistent(true);
}
if (!dirtyObjects.isEmpty())
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 5ac3d46..2b4081b 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
@@ -23,7 +23,6 @@ import org.eclipse.emf.cdo.analyzer.CDOFeatureAnalyzer;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.EresourceFactory;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
-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.CDOIDMeta;
@@ -375,7 +374,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
}
InternalCDORevision revision = getRevision(id);
- CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
+ CDOClass cdoClass = revision.getCDOClass();
InternalCDOObject object = newInstance(cdoClass);
if (object instanceof CDOResourceImpl)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
index c10727c..088b10d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.internal.cdo.protocol;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
+import org.eclipse.emf.cdo.internal.protocol.model.InternalCDOPackage;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.id.CDOID;
@@ -127,7 +127,7 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
{
CDOIDMetaRange oldRange = newPackage.getMetaIDRange();
CDOIDMetaRange newRange = CDOIDUtil.readMetaRange(in);
- ((CDOPackageImpl)newPackage).setMetaIDRange(newRange);
+ ((InternalCDOPackage)newPackage).setMetaIDRange(newRange);
for (int i = 0; i < oldRange.size(); i++)
{
CDOIDTemp oldID = (CDOIDTemp)oldRange.get(i);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java
index 3c59130..2dbb00e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java
@@ -10,8 +10,9 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
+import org.eclipse.emf.cdo.internal.protocol.model.InternalCDOPackage;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
@@ -24,9 +25,9 @@ import java.io.IOException;
*/
public class LoadPackageRequest extends CDOClientRequest<Object>
{
- private CDOPackageImpl cdoPackage;
+ private CDOPackage cdoPackage;
- public LoadPackageRequest(IChannel channel, CDOPackageImpl cdoPackage)
+ public LoadPackageRequest(IChannel channel, CDOPackage cdoPackage)
{
super(channel);
this.cdoPackage = cdoPackage;
@@ -47,7 +48,7 @@ public class LoadPackageRequest extends CDOClientRequest<Object>
@Override
protected Object confirming(ExtendedDataInputStream in) throws IOException
{
- cdoPackage.read(in);
+ ((InternalCDOPackage)cdoPackage).read(in);
return null;
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
index 9dde5c1..e6d9a9d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
@@ -11,9 +11,10 @@
package org.eclipse.emf.internal.cdo.util;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassProxy;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
+import org.eclipse.emf.cdo.internal.protocol.model.InternalCDOClass;
+import org.eclipse.emf.cdo.internal.protocol.model.InternalCDOFeature;
+import org.eclipse.emf.cdo.internal.protocol.model.InternalCDOPackage;
import org.eclipse.emf.cdo.protocol.id.CDOIDMetaRange;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
@@ -101,11 +102,11 @@ public final class ModelUtil
public static void initializeCDOPackage(EPackage ePackage, CDOPackage cdoPackage)
{
- cdoPackage.setClientInfo(ePackage);
+ ((InternalCDOPackage)cdoPackage).setClientInfo(ePackage);
for (EClass eClass : EMFUtil.getPersistentClasses(ePackage))
{
CDOClass cdoClass = createCDOClass(eClass, cdoPackage);
- ((CDOPackageImpl)cdoPackage).addClass(cdoClass);
+ ((InternalCDOPackage)cdoPackage).addClass(cdoClass);
}
}
@@ -160,20 +161,20 @@ public final class ModelUtil
private static CDOClass createCDOClass(EClass eClass, CDOPackage containingPackage)
{
- CDOClass cdoClass = CDOModelUtil.createClass(containingPackage, eClass.getClassifierID(), eClass.getName(), eClass
- .isAbstract());
+ InternalCDOClass cdoClass = (InternalCDOClass)CDOModelUtil.createClass(containingPackage, eClass.getClassifierID(),
+ eClass.getName(), eClass.isAbstract());
cdoClass.setClientInfo(eClass);
for (EClass superType : eClass.getESuperTypes())
{
CDOClassRef classRef = createClassRef(superType);
- ((CDOClassImpl)cdoClass).addSuperType(classRef);
+ cdoClass.addSuperType(classRef);
}
for (EStructuralFeature eFeature : EMFUtil.getPersistentFeatures(eClass.getEStructuralFeatures()))
{
CDOFeature cdoFeature = createCDOFeature(eFeature, cdoClass);
- ((CDOClassImpl)cdoClass).addFeature(cdoFeature);
+ cdoClass.addFeature(cdoFeature);
}
return cdoClass;
@@ -181,8 +182,8 @@ public final class ModelUtil
private static CDOFeature createCDOFeature(EStructuralFeature eFeature, CDOClass containingClass)
{
- CDOFeature cdoFeature = EMFUtil.isReference(eFeature) ? createCDOReference((EReference)eFeature, containingClass)
- : createCDOAttribute((EAttribute)eFeature, containingClass);
+ InternalCDOFeature cdoFeature = (InternalCDOFeature)(EMFUtil.isReference(eFeature) ? createCDOReference(
+ (EReference)eFeature, containingClass) : createCDOAttribute((EAttribute)eFeature, containingClass));
cdoFeature.setClientInfo(eFeature);
return cdoFeature;
}
@@ -230,7 +231,7 @@ public final class ModelUtil
packageRegistry.put(uri, ePackage);
}
- cdoPackage.setClientInfo(ePackage);
+ ((InternalCDOPackage)cdoPackage).setClientInfo(ePackage);
}
return ePackage;
@@ -243,7 +244,7 @@ public final class ModelUtil
{
EPackage ePackage = getEPackage(cdoClass.getContainingPackage(), packageRegistry);
eClass = (EClass)ePackage.getEClassifier(cdoClass.getName());
- cdoClass.setClientInfo(eClass);
+ ((InternalCDOClass)cdoClass).setClientInfo(eClass);
}
return eClass;
@@ -256,7 +257,7 @@ public final class ModelUtil
{
EClass eClass = getEClass(cdoFeature.getContainingClass(), packageRegistry);
eFeature = eClass.getEStructuralFeature(cdoFeature.getFeatureID());
- cdoFeature.setClientInfo(eFeature);
+ ((InternalCDOFeature)cdoFeature).setClientInfo(eFeature);
}
return eFeature;
@@ -316,32 +317,17 @@ public final class ModelUtil
{
// Ecore
CDOCorePackage corePackage = packageManager.getCDOCorePackage();
- corePackage.setClientInfo(EcorePackage.eINSTANCE);
- corePackage.getCDOObjectClass().setClientInfo(EcorePackage.eINSTANCE.getEObject());
+ ((InternalCDOPackage)corePackage).setClientInfo(EcorePackage.eINSTANCE);
+ ((InternalCDOClass)corePackage.getCDOObjectClass()).setClientInfo(EcorePackage.eINSTANCE.getEObject());
// Eresource
CDOResourcePackage resourcePackage = packageManager.getCDOResourcePackage();
- resourcePackage.setClientInfo(EresourcePackage.eINSTANCE);
+ ((InternalCDOPackage)resourcePackage).setClientInfo(EresourcePackage.eINSTANCE);
CDOResourceClass resourceClass = resourcePackage.getCDOResourceClass();
- resourceClass.setClientInfo(EresourcePackage.eINSTANCE.getCDOResource());
- resourceClass.getCDOContentsFeature().setClientInfo(EresourcePackage.eINSTANCE.getCDOResource_Contents());
- resourceClass.getCDOPathFeature().setClientInfo(EresourcePackage.eINSTANCE.getCDOResource_Path());
- }
-
- @Deprecated
- public static void removeModelInfos(CDOSessionPackageManagerImpl packageManager)
- {
- // Ecore
- CDOCorePackage corePackage = packageManager.getCDOCorePackage();
- corePackage.setClientInfo(null);
- corePackage.getCDOObjectClass().setClientInfo(null);
-
- // Eresource
- CDOResourcePackage resourcePackage = packageManager.getCDOResourcePackage();
- resourcePackage.setClientInfo(null);
- CDOResourceClass resourceClass = resourcePackage.getCDOResourceClass();
- resourceClass.setClientInfo(null);
- resourceClass.getCDOContentsFeature().setClientInfo(null);
- resourceClass.getCDOPathFeature().setClientInfo(null);
+ ((InternalCDOClass)resourceClass).setClientInfo(EresourcePackage.eINSTANCE.getCDOResource());
+ ((InternalCDOFeature)resourceClass.getCDOContentsFeature()).setClientInfo(EresourcePackage.eINSTANCE
+ .getCDOResource_Contents());
+ ((InternalCDOFeature)resourceClass.getCDOPathFeature()).setClientInfo(EresourcePackage.eINSTANCE
+ .getCDOResource_Path());
}
}