Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-06-09 05:32:40 +0000
committerEike Stepper2008-06-09 05:32:40 +0000
commit657aa8c041a7ae6132b8c9a147cf8564e8eb8efc (patch)
treeae60c5fb4dd8b9f4bc97fbeb9f5805e3ebb13524 /plugins
parentbee461ecb818a902783e0beea68d7c653e64f452 (diff)
downloadcdo-657aa8c041a7ae6132b8c9a147cf8564e8eb8efc.tar.gz
cdo-657aa8c041a7ae6132b8c9a147cf8564e8eb8efc.tar.xz
cdo-657aa8c041a7ae6132b8c9a147cf8564e8eb8efc.zip
[234829] [Hibernate] Problem with containingClass of CDOFeatures
https://bugs.eclipse.org/bugs/show_bug.cgi?id=234829
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOFeature.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOFeatureImpl.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOFeature.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java3
4 files changed, 26 insertions, 15 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOFeature.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOFeature.java
index 4e3f8d6203..35c1cfa9c0 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOFeature.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOFeature.java
@@ -29,8 +29,6 @@ public interface CDOFeature extends CDOModelElement
public CDOClass getReferenceType();
- public CDOClassProxy getReferenceTypeProxy();
-
public CDOClass getContainingClass();
public CDOPackage getContainingPackage();
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOFeatureImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOFeatureImpl.java
index 76b2a8a3dd..1c05546d44 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOFeatureImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOFeatureImpl.java
@@ -51,7 +51,7 @@ public class CDOFeatureImpl extends CDOModelElementImpl implements InternalCDOFe
private boolean containment;
- private CDOClassProxy referenceType;
+ private CDOClassProxy referenceTypeProxy;
public CDOFeatureImpl()
{
@@ -75,13 +75,13 @@ public class CDOFeatureImpl extends CDOModelElementImpl implements InternalCDOFe
}
}
- public CDOFeatureImpl(CDOClass containingClass, int featureID, String name, CDOClassProxy referenceType,
+ public CDOFeatureImpl(CDOClass containingClass, int featureID, String name, CDOClassProxy referenceTypeProxy,
boolean many, boolean containment)
{
super(name);
- if (referenceType == null)
+ if (referenceTypeProxy == null)
{
- throw new IllegalArgumentException("referenceType == null");
+ throw new IllegalArgumentException("referenceTypeProxy == null");
}
this.containingClass = containingClass;
@@ -89,7 +89,7 @@ public class CDOFeatureImpl extends CDOModelElementImpl implements InternalCDOFe
type = CDOType.OBJECT;
this.many = many;
this.containment = containment;
- this.referenceType = referenceType;
+ this.referenceTypeProxy = referenceTypeProxy;
if (MODEL.isEnabled())
{
MODEL.format("Created {0}", this);
@@ -125,7 +125,7 @@ public class CDOFeatureImpl extends CDOModelElementImpl implements InternalCDOFe
PROTOCOL.format("Read reference type: classRef={0}", classRef);
}
- referenceType = new CDOClassProxy(classRef, containingClass.getContainingPackage().getPackageManager());
+ referenceTypeProxy = new CDOClassProxy(classRef, containingClass.getContainingPackage().getPackageManager());
}
}
@@ -146,7 +146,7 @@ public class CDOFeatureImpl extends CDOModelElementImpl implements InternalCDOFe
if (isReference())
{
- CDOClassRef classRef = referenceType.getClassRef();
+ CDOClassRef classRef = referenceTypeProxy.getClassRef();
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Writing reference type: classRef={0}", classRef);
@@ -238,28 +238,33 @@ public class CDOFeatureImpl extends CDOModelElementImpl implements InternalCDOFe
public CDOClass getReferenceType()
{
- if (referenceType == null)
+ if (referenceTypeProxy == null)
{
return null;
}
- return referenceType.getCdoClass();
+ return referenceTypeProxy.getCdoClass();
+ }
+
+ public void setReferenceType(CDOClassRef cdoClassRef)
+ {
+ referenceTypeProxy = new CDOClassProxy(cdoClassRef, getPackageManager());
}
public void setReferenceType(CDOClass cdoClass)
{
- referenceType = new CDOClassProxy(cdoClass);
+ referenceTypeProxy = new CDOClassProxy(cdoClass);
}
public CDOClassProxy getReferenceTypeProxy()
{
- return referenceType;
+ return referenceTypeProxy;
}
@Override
public String toString()
{
- return MessageFormat.format("CDOFeature(ID={0}, name={1}, type={2}, referenceType={3})", featureID, getName(),
+ return MessageFormat.format("CDOFeature(ID={0}, name={1}, type={2}, referenceTypeProxy={3})", featureID, getName(),
getType(), getReferenceTypeProxy());
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOFeature.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOFeature.java
index d37bdfad9c..ba48483614 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOFeature.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/InternalCDOFeature.java
@@ -11,6 +11,8 @@
package org.eclipse.emf.cdo.spi.common;
import org.eclipse.emf.cdo.common.model.CDOClass;
+import org.eclipse.emf.cdo.common.model.CDOClassProxy;
+import org.eclipse.emf.cdo.common.model.CDOClassRef;
import org.eclipse.emf.cdo.common.model.CDOFeature;
/**
@@ -18,9 +20,14 @@ import org.eclipse.emf.cdo.common.model.CDOFeature;
*/
public interface InternalCDOFeature extends CDOFeature, InternalCDOModelElement
{
+ public CDOClassProxy getReferenceTypeProxy();
+
public void setContainingClass(CDOClass containingClass);
public void setFeatureIndex(int featureIndex);
+ public void setReferenceType(CDOClassRef cdoClassRef);
+
+ @Deprecated
public void setReferenceType(CDOClass cdoClass);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
index 7b775d232c..df8ed692ec 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.cdo.server.db.IDBStoreWriter;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.emf.cdo.spi.common.InternalCDOClass;
+import org.eclipse.emf.cdo.spi.common.InternalCDOFeature;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBUtil;
@@ -176,7 +177,7 @@ public class DBStoreWriter extends DBStoreReader implements IDBStoreWriter
String name = feature.getName();
int featureID = feature.getFeatureID();
int type = feature.getType().getTypeID();
- CDOClassProxy reference = feature.getReferenceTypeProxy();
+ CDOClassProxy reference = ((InternalCDOFeature)feature).getReferenceTypeProxy();
String packageURI = reference == null ? null : reference.getPackageURI();
int classifierID = reference == null ? 0 : reference.getClassifierID();
boolean many = feature.isMany();

Back to the top