summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-04-20 04:22:22 (EDT)
committerEike Stepper2008-04-20 04:22:22 (EDT)
commitec4089b99e29ea04aa86851bed7249440ab8fd2d (patch)
treed99d5f200179614942315e54f6b3ba856299cdd1
parentd014f643cba4c2ba8c3f5939e5ff992e50786295 (diff)
downloadcdo-ec4089b99e29ea04aa86851bed7249440ab8fd2d.zip
cdo-ec4089b99e29ea04aa86851bed7249440ab8fd2d.tar.gz
cdo-ec4089b99e29ea04aa86851bed7249440ab8fd2d.tar.bz2
[226710] Containment problem when we set to NULL
https://bugs.eclipse.org/bugs/show_bug.cgi?id=226710
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/SpecialPurchaseOrder.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/SpecialPurchaseOrderImpl.java24
5 files changed, 102 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
index b5a817e..21a24d7 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
@@ -5,5 +5,7 @@
nsURI="http://www.eclipse.org/emf/CDO/tests/model2/1.0.0" nsPrefix="model2">
<eClassifiers xsi:type="ecore:EClass" name="SpecialPurchaseOrder" eSuperTypes="../../org.eclipse.emf.cdo.tests.model1/model/model1.ecore#//PurchaseOrder">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="discountCode" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="shippingAddress" eType="ecore:EClass ../../org.eclipse.emf.cdo.tests.model1/model/model1.ecore#//Address"
+ containment="true"/>
</eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java
index fdc9b01..011ab5e 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: Model2Package.java,v 1.2 2008-04-07 08:28:21 estepper Exp $
+ * $Id: Model2Package.java,v 1.3 2008-04-20 08:22:20 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2;
@@ -11,6 +11,7 @@ import org.eclipse.emf.cdo.tests.model1.Model1Package;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
/**
* <!-- begin-user-doc --> The <b>Package</b> for the model. It contains accessors for the meta objects to represent
@@ -101,13 +102,22 @@ public interface Model2Package extends EPackage
int SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE = Model1Package.PURCHASE_ORDER_FEATURE_COUNT + 0;
/**
+ * The feature id for the '<em><b>Shipping Address</b></em>' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS = Model1Package.PURCHASE_ORDER_FEATURE_COUNT + 1;
+
+ /**
* The number of structural features of the '<em>Special Purchase Order</em>' class. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
* @ordered
*/
- int SPECIAL_PURCHASE_ORDER_FEATURE_COUNT = Model1Package.PURCHASE_ORDER_FEATURE_COUNT + 1;
+ int SPECIAL_PURCHASE_ORDER_FEATURE_COUNT = Model1Package.PURCHASE_ORDER_FEATURE_COUNT + 2;
/**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder <em>Special Purchase Order</em>}'.
@@ -131,6 +141,17 @@ public interface Model2Package extends EPackage
EAttribute getSpecialPurchaseOrder_DiscountCode();
/**
+ * Returns the meta object for the containment reference '{@link org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder#getShippingAddress <em>Shipping Address</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the containment reference '<em>Shipping Address</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder#getShippingAddress()
+ * @see #getSpecialPurchaseOrder()
+ * @generated
+ */
+ EReference getSpecialPurchaseOrder_ShippingAddress();
+
+ /**
* Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the factory that creates the instances of the model.
@@ -170,6 +191,14 @@ public interface Model2Package extends EPackage
*/
EAttribute SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE = eINSTANCE.getSpecialPurchaseOrder_DiscountCode();
+ /**
+ * The meta object literal for the '<em><b>Shipping Address</b></em>' containment reference feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EReference SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS = eINSTANCE.getSpecialPurchaseOrder_ShippingAddress();
+
}
} // Model2Package
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/SpecialPurchaseOrder.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/SpecialPurchaseOrder.java
index d76f142..e3914d0 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/SpecialPurchaseOrder.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/SpecialPurchaseOrder.java
@@ -2,10 +2,11 @@
* <copyright>
* </copyright>
*
- * $Id: SpecialPurchaseOrder.java,v 1.2 2008-04-07 08:28:21 estepper Exp $
+ * $Id: SpecialPurchaseOrder.java,v 1.3 2008-04-20 08:22:20 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2;
+import org.eclipse.emf.cdo.tests.model1.Address;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
/**
@@ -15,6 +16,7 @@ import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder#getDiscountCode <em>Discount Code</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder#getShippingAddress <em>Shipping Address</em>}</li>
* </ul>
* </p>
*
@@ -51,4 +53,31 @@ public interface SpecialPurchaseOrder extends PurchaseOrder
*/
void setDiscountCode(String value);
+ /**
+ * Returns the value of the '<em><b>Shipping Address</b></em>' containment reference. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Shipping Address</em>' containment reference isn't clear, there really should be
+ * more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Shipping Address</em>' containment reference.
+ * @see #setShippingAddress(Address)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getSpecialPurchaseOrder_ShippingAddress()
+ * @model containment="true"
+ * @generated
+ */
+ Address getShippingAddress();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder#getShippingAddress <em>Shipping Address</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Shipping Address</em>' containment reference.
+ * @see #getShippingAddress()
+ * @generated
+ */
+ void setShippingAddress(Address value);
+
} // SpecialPurchaseOrder
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java
index 27aa7b5..ed8daac 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: Model2PackageImpl.java,v 1.2 2008-04-07 08:28:21 estepper Exp $
+ * $Id: Model2PackageImpl.java,v 1.3 2008-04-20 08:22:20 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2.impl;
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
/**
@@ -124,6 +125,16 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
*
* @generated
*/
+ public EReference getSpecialPurchaseOrder_ShippingAddress()
+ {
+ return (EReference)specialPurchaseOrderEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Model2Factory getModel2Factory()
{
return (Model2Factory)getEFactoryInstance();
@@ -150,6 +161,7 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
// Create classes and their features
specialPurchaseOrderEClass = createEClass(SPECIAL_PURCHASE_ORDER);
createEAttribute(specialPurchaseOrderEClass, SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE);
+ createEReference(specialPurchaseOrderEClass, SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS);
}
/**
@@ -191,6 +203,9 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
initEAttribute(getSpecialPurchaseOrder_DiscountCode(), ecorePackage.getEString(), "discountCode", null, 0, 1,
SpecialPurchaseOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
+ initEReference(getSpecialPurchaseOrder_ShippingAddress(), theModel1Package.getAddress(), null, "shippingAddress",
+ null, 0, 1, SpecialPurchaseOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
+ !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/SpecialPurchaseOrderImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/SpecialPurchaseOrderImpl.java
index 6b00a25..3c72133 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/SpecialPurchaseOrderImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/SpecialPurchaseOrderImpl.java
@@ -2,10 +2,11 @@
* <copyright>
* </copyright>
*
- * $Id: SpecialPurchaseOrderImpl.java,v 1.2 2008-04-07 08:28:21 estepper Exp $
+ * $Id: SpecialPurchaseOrderImpl.java,v 1.3 2008-04-20 08:22:20 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2.impl;
+import org.eclipse.emf.cdo.tests.model1.Address;
import org.eclipse.emf.cdo.tests.model1.impl.PurchaseOrderImpl;
import org.eclipse.emf.cdo.tests.model2.Model2Package;
import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder;
@@ -19,6 +20,7 @@ import org.eclipse.emf.ecore.EClass;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.cdo.tests.model2.impl.SpecialPurchaseOrderImpl#getDiscountCode <em>Discount Code</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.SpecialPurchaseOrderImpl#getShippingAddress <em>Shipping Address</em>}</li>
* </ul>
* </p>
*
@@ -67,4 +69,24 @@ public class SpecialPurchaseOrderImpl extends PurchaseOrderImpl implements Speci
eSet(Model2Package.Literals.SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE, newDiscountCode);
}
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Address getShippingAddress()
+ {
+ return (Address)eGet(Model2Package.Literals.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setShippingAddress(Address newShippingAddress)
+ {
+ eSet(Model2Package.Literals.SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS, newShippingAddress);
+ }
+
} // SpecialPurchaseOrderImpl