summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-04-12 06:05:44 (EDT)
committerEike Stepper2008-04-12 06:05:44 (EDT)
commit7d9620fa8eaa07476041e20ddd1d6402fee3bc24 (patch)
tree5202f3b7387c620478bac63a19c18e2fa0d64d4b
parent124ca4bb25d249d891ac9a5d434e1eef3d3a31b0 (diff)
downloadcdo-7d9620fa8eaa07476041e20ddd1d6402fee3bc24.zip
cdo-7d9620fa8eaa07476041e20ddd1d6402fee3bc24.tar.gz
cdo-7d9620fa8eaa07476041e20ddd1d6402fee3bc24.tar.bz2
[226317] Multiple Inheritence Wrong featureID
https://bugs.eclipse.org/bugs/show_bug.cgi?id=226317
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/model/model1.ecore3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Factory.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Package.java127
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/OrderAddress.java52
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java40
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/OrderAddressImpl.java218
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1AdapterFactory.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java26
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java61
10 files changed, 569 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.ecore b/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.ecore
index 7f1f538..716968f 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.ecore
@@ -69,4 +69,7 @@
<eLiterals name="vat7" value="7"/>
<eLiterals name="vat15" value="15"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="OrderAddress" eSuperTypes="#//Address #//Order #//OrderDetail">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testAttribute" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Factory.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Factory.java
index 686ca83..d19c6fb 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Factory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Factory.java
@@ -65,6 +65,14 @@ public interface Model1Factory extends EFactory
Product createProduct();
/**
+ * Returns a new object of class '<em>Order Address</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Order Address</em>'.
+ * @generated
+ */
+ OrderAddress createOrderAddress();
+
+ /**
* Returns a new object of class '<em>Category</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return a new object of class '<em>Category</em>'.
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Package.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Package.java
index 411017a..eb07a66 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Package.java
@@ -591,6 +591,92 @@ public interface Model1Package extends EPackage
int PRODUCT_FEATURE_COUNT = 3;
/**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl <em>Order Address</em>}'
+ * class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl
+ * @see org.eclipse.emf.cdo.tests.model1.impl.Model1PackageImpl#getOrderAddress()
+ * @generated
+ */
+ int ORDER_ADDRESS = 10;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS__NAME = ADDRESS__NAME;
+
+ /**
+ * The feature id for the '<em><b>Street</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS__STREET = ADDRESS__STREET;
+
+ /**
+ * The feature id for the '<em><b>City</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS__CITY = ADDRESS__CITY;
+
+ /**
+ * The feature id for the '<em><b>Order Details</b></em>' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS__ORDER_DETAILS = ADDRESS_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Order</b></em>' container reference. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS__ORDER = ADDRESS_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Product</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS__PRODUCT = ADDRESS_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Price</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS__PRICE = ADDRESS_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>Test Attribute</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS__TEST_ATTRIBUTE = ADDRESS_FEATURE_COUNT + 4;
+
+ /**
+ * The number of structural features of the '<em>Order Address</em>' class. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORDER_ADDRESS_FEATURE_COUNT = ADDRESS_FEATURE_COUNT + 5;
+
+ /**
* The meta object id for the '{@link org.eclipse.emf.cdo.tests.model1.VAT <em>VAT</em>}' enum. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
@@ -598,7 +684,7 @@ public interface Model1Package extends EPackage
* @see org.eclipse.emf.cdo.tests.model1.impl.Model1PackageImpl#getVAT()
* @generated
*/
- int VAT = 10;
+ int VAT = 11;
/**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model1.Supplier <em>Supplier</em>}'. <!--
@@ -751,6 +837,27 @@ public interface Model1Package extends EPackage
EAttribute getProduct_Vat();
/**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model1.OrderAddress <em>Order Address</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Order Address</em>'.
+ * @see org.eclipse.emf.cdo.tests.model1.OrderAddress
+ * @generated
+ */
+ EClass getOrderAddress();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.model1.OrderAddress#isTestAttribute <em>Test Attribute</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Test Attribute</em>'.
+ * @see org.eclipse.emf.cdo.tests.model1.OrderAddress#isTestAttribute()
+ * @see #getOrderAddress()
+ * @generated
+ */
+ EAttribute getOrderAddress_TestAttribute();
+
+ /**
* Returns the meta object for enum '{@link org.eclipse.emf.cdo.tests.model1.VAT <em>VAT</em>}'. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
@@ -1119,6 +1226,24 @@ public interface Model1Package extends EPackage
EAttribute PRODUCT__VAT = eINSTANCE.getProduct_Vat();
/**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl <em>Order Address</em>}'
+ * class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl
+ * @see org.eclipse.emf.cdo.tests.model1.impl.Model1PackageImpl#getOrderAddress()
+ * @generated
+ */
+ EClass ORDER_ADDRESS = eINSTANCE.getOrderAddress();
+
+ /**
+ * The meta object literal for the '<em><b>Test Attribute</b></em>' attribute feature. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute ORDER_ADDRESS__TEST_ATTRIBUTE = eINSTANCE.getOrderAddress_TestAttribute();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model1.VAT <em>VAT</em>}' enum. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/OrderAddress.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/OrderAddress.java
new file mode 100644
index 0000000..e2feaa1
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/OrderAddress.java
@@ -0,0 +1,52 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: OrderAddress.java,v 1.1 2008-04-12 10:05:44 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.model1;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Order Address</b></em>'. <!-- end-user-doc
+ * -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.OrderAddress#isTestAttribute <em>Test Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.cdo.tests.model1.Model1Package#getOrderAddress()
+ * @model
+ * @generated
+ */
+public interface OrderAddress extends Address, Order, OrderDetail
+{
+ /**
+ * Returns the value of the '<em><b>Test Attribute</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Test Attribute</em>' attribute isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Test Attribute</em>' attribute.
+ * @see #setTestAttribute(boolean)
+ * @see org.eclipse.emf.cdo.tests.model1.Model1Package#getOrderAddress_TestAttribute()
+ * @model
+ * @generated
+ */
+ boolean isTestAttribute();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model1.OrderAddress#isTestAttribute <em>Test Attribute</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Test Attribute</em>' attribute.
+ * @see #isTestAttribute()
+ * @generated
+ */
+ void setTestAttribute(boolean value);
+
+} // OrderAddress
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java
index b499935..421cd4e 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java
@@ -13,6 +13,7 @@ import org.eclipse.emf.cdo.tests.model1.Customer;
import org.eclipse.emf.cdo.tests.model1.Model1Factory;
import org.eclipse.emf.cdo.tests.model1.Model1Package;
import org.eclipse.emf.cdo.tests.model1.Order;
+import org.eclipse.emf.cdo.tests.model1.OrderAddress;
import org.eclipse.emf.cdo.tests.model1.OrderDetail;
import org.eclipse.emf.cdo.tests.model1.Product;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
@@ -97,6 +98,8 @@ public class Model1FactoryImpl extends EFactoryImpl implements Model1Factory
return (EObject)createCategory();
case Model1Package.PRODUCT:
return (EObject)createProduct();
+ case Model1Package.ORDER_ADDRESS:
+ return (EObject)createOrderAddress();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -196,6 +199,17 @@ public class Model1FactoryImpl extends EFactoryImpl implements Model1Factory
*
* @generated
*/
+ public OrderAddress createOrderAddress()
+ {
+ OrderAddressImpl orderAddress = new OrderAddressImpl();
+ return orderAddress;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public VAT createVATFromString(EDataType eDataType, String initialValue)
{
VAT result = VAT.get(initialValue);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java
index 19c2516..319b3ca 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java
@@ -13,6 +13,7 @@ import org.eclipse.emf.cdo.tests.model1.Customer;
import org.eclipse.emf.cdo.tests.model1.Model1Factory;
import org.eclipse.emf.cdo.tests.model1.Model1Package;
import org.eclipse.emf.cdo.tests.model1.Order;
+import org.eclipse.emf.cdo.tests.model1.OrderAddress;
import org.eclipse.emf.cdo.tests.model1.OrderDetail;
import org.eclipse.emf.cdo.tests.model1.Product;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
@@ -73,6 +74,13 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
*
* @generated
*/
+ private EClass orderAddressEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
private EEnum vatEEnum = null;
/**
@@ -361,6 +369,26 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
*
* @generated
*/
+ public EClass getOrderAddress()
+ {
+ return orderAddressEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getOrderAddress_TestAttribute()
+ {
+ return (EAttribute)orderAddressEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public EEnum getVAT()
{
return vatEEnum;
@@ -610,6 +638,9 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
createEReference(productEClass, PRODUCT__ORDER_DETAILS);
createEAttribute(productEClass, PRODUCT__VAT);
+ orderAddressEClass = createEClass(ORDER_ADDRESS);
+ createEAttribute(orderAddressEClass, ORDER_ADDRESS__TEST_ATTRIBUTE);
+
// Create enums
vatEEnum = createEEnum(VAT);
}
@@ -647,6 +678,9 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
customerEClass.getESuperTypes().add(this.getAddress());
purchaseOrderEClass.getESuperTypes().add(this.getOrder());
salesOrderEClass.getESuperTypes().add(this.getOrder());
+ orderAddressEClass.getESuperTypes().add(this.getAddress());
+ orderAddressEClass.getESuperTypes().add(this.getOrder());
+ orderAddressEClass.getESuperTypes().add(this.getOrderDetail());
// Initialize classes and features; add operations and parameters
initEClass(addressEClass, Address.class, "Address", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -737,6 +771,12 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
initEAttribute(getProduct_Vat(), this.getVAT(), "vat", "vat15", 0, 1, Product.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(orderAddressEClass, OrderAddress.class, "OrderAddress", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getOrderAddress_TestAttribute(), ecorePackage.getEBoolean(), "testAttribute", null, 0, 1,
+ OrderAddress.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
+
// Initialize enums and add enum literals
initEEnum(vatEEnum, org.eclipse.emf.cdo.tests.model1.VAT.class, "VAT");
addEEnumLiteral(vatEEnum, org.eclipse.emf.cdo.tests.model1.VAT.VAT0);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/OrderAddressImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/OrderAddressImpl.java
new file mode 100644
index 0000000..ab8e6f1
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/OrderAddressImpl.java
@@ -0,0 +1,218 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: OrderAddressImpl.java,v 1.1 2008-04-12 10:05:44 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.model1.impl;
+
+import org.eclipse.emf.cdo.tests.model1.Model1Package;
+import org.eclipse.emf.cdo.tests.model1.Order;
+import org.eclipse.emf.cdo.tests.model1.OrderAddress;
+import org.eclipse.emf.cdo.tests.model1.OrderDetail;
+import org.eclipse.emf.cdo.tests.model1.Product;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Order Address</b></em>'. <!-- end-user-doc
+ * -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl#getOrderDetails <em>Order Details</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl#getOrder <em>Order</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl#getProduct <em>Product</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl#getPrice <em>Price</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.impl.OrderAddressImpl#isTestAttribute <em>Test Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class OrderAddressImpl extends AddressImpl implements OrderAddress
+{
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected OrderAddressImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return Model1Package.Literals.ORDER_ADDRESS;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EList<OrderDetail> getOrderDetails()
+ {
+ return (EList<OrderDetail>)eGet(Model1Package.Literals.ORDER__ORDER_DETAILS, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Order getOrder()
+ {
+ return (Order)eGet(Model1Package.Literals.ORDER_DETAIL__ORDER, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOrder(Order newOrder)
+ {
+ eSet(Model1Package.Literals.ORDER_DETAIL__ORDER, newOrder);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Product getProduct()
+ {
+ return (Product)eGet(Model1Package.Literals.ORDER_DETAIL__PRODUCT, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setProduct(Product newProduct)
+ {
+ eSet(Model1Package.Literals.ORDER_DETAIL__PRODUCT, newProduct);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public float getPrice()
+ {
+ return ((Float)eGet(Model1Package.Literals.ORDER_DETAIL__PRICE, true)).floatValue();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setPrice(float newPrice)
+ {
+ eSet(Model1Package.Literals.ORDER_DETAIL__PRICE, new Float(newPrice));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isTestAttribute()
+ {
+ return ((Boolean)eGet(Model1Package.Literals.ORDER_ADDRESS__TEST_ATTRIBUTE, true)).booleanValue();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTestAttribute(boolean newTestAttribute)
+ {
+ eSet(Model1Package.Literals.ORDER_ADDRESS__TEST_ATTRIBUTE, new Boolean(newTestAttribute));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
+ {
+ if (baseClass == Order.class)
+ {
+ switch (derivedFeatureID)
+ {
+ case Model1Package.ORDER_ADDRESS__ORDER_DETAILS:
+ return Model1Package.ORDER__ORDER_DETAILS;
+ default:
+ return -1;
+ }
+ }
+ if (baseClass == OrderDetail.class)
+ {
+ switch (derivedFeatureID)
+ {
+ case Model1Package.ORDER_ADDRESS__ORDER:
+ return Model1Package.ORDER_DETAIL__ORDER;
+ case Model1Package.ORDER_ADDRESS__PRODUCT:
+ return Model1Package.ORDER_DETAIL__PRODUCT;
+ case Model1Package.ORDER_ADDRESS__PRICE:
+ return Model1Package.ORDER_DETAIL__PRICE;
+ default:
+ return -1;
+ }
+ }
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
+ {
+ if (baseClass == Order.class)
+ {
+ switch (baseFeatureID)
+ {
+ case Model1Package.ORDER__ORDER_DETAILS:
+ return Model1Package.ORDER_ADDRESS__ORDER_DETAILS;
+ default:
+ return -1;
+ }
+ }
+ if (baseClass == OrderDetail.class)
+ {
+ switch (baseFeatureID)
+ {
+ case Model1Package.ORDER_DETAIL__ORDER:
+ return Model1Package.ORDER_ADDRESS__ORDER;
+ case Model1Package.ORDER_DETAIL__PRODUCT:
+ return Model1Package.ORDER_ADDRESS__PRODUCT;
+ case Model1Package.ORDER_DETAIL__PRICE:
+ return Model1Package.ORDER_ADDRESS__PRICE;
+ default:
+ return -1;
+ }
+ }
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+} // OrderAddressImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1AdapterFactory.java
index 007220c..3fa2016 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1AdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1AdapterFactory.java
@@ -12,6 +12,7 @@ import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.tests.model1.Customer;
import org.eclipse.emf.cdo.tests.model1.Model1Package;
import org.eclipse.emf.cdo.tests.model1.Order;
+import org.eclipse.emf.cdo.tests.model1.OrderAddress;
import org.eclipse.emf.cdo.tests.model1.OrderDetail;
import org.eclipse.emf.cdo.tests.model1.Product;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
@@ -142,6 +143,12 @@ public class Model1AdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseOrderAddress(OrderAddress object)
+ {
+ return createOrderAddressAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object)
{
return createEObjectAdapter();
@@ -233,6 +240,20 @@ public class Model1AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model1.OrderAddress <em>Order Address</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to
+ * ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.tests.model1.OrderAddress
+ * @generated
+ */
+ public Adapter createOrderAddressAdapter()
+ {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model1.Category <em>Category</em>}'.
* <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to
* ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java
index 633e291..920c302 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java
@@ -12,6 +12,7 @@ import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.tests.model1.Customer;
import org.eclipse.emf.cdo.tests.model1.Model1Package;
import org.eclipse.emf.cdo.tests.model1.Order;
+import org.eclipse.emf.cdo.tests.model1.OrderAddress;
import org.eclipse.emf.cdo.tests.model1.OrderDetail;
import org.eclipse.emf.cdo.tests.model1.Product;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
@@ -172,6 +173,16 @@ public class Model1Switch<T>
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case Model1Package.ORDER_ADDRESS:
+ {
+ OrderAddress orderAddress = (OrderAddress)theEObject;
+ T result = caseOrderAddress(orderAddress);
+ if (result == null) result = caseAddress(orderAddress);
+ if (result == null) result = caseOrder(orderAddress);
+ if (result == null) result = caseOrderDetail(orderAddress);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -253,6 +264,21 @@ public class Model1Switch<T>
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Order Address</em>'. <!-- begin-user-doc
+ * --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Order Address</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseOrderAddress(OrderAddress object)
+ {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Category</em>'. <!-- begin-user-doc -->
* This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
index 6bb65cd..7890f33 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
@@ -15,6 +15,9 @@ import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.tests.model1.Model1Factory;
+import org.eclipse.emf.cdo.tests.model1.Model1Package;
+import org.eclipse.emf.cdo.tests.model1.OrderAddress;
+import org.eclipse.emf.cdo.tests.model1.OrderDetail;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
import org.eclipse.emf.cdo.tests.model1.Supplier;
import org.eclipse.emf.cdo.util.CDOUtil;
@@ -623,4 +626,62 @@ public class InitialTest extends AbstractCDOTest
msg("Verifying name");
assertEquals("Stepper", s.getName());
}
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=226317
+ */
+ public void testMultipleInheritence() throws Exception
+ {
+ CDOSession session = openModel1Session();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource("/test1");
+ OrderAddress orderAddress = Model1Factory.eINSTANCE.createOrderAddress();
+ resource.getContents().add(orderAddress);
+
+ assertEquals(Model1Package.eINSTANCE.getAddress_City().getFeatureID(), Model1Package.eINSTANCE
+ .getOrderDetail_Price().getFeatureID());
+
+ orderAddress.setCity("ALLO");
+ orderAddress.setPrice(2.8f);
+ orderAddress.setTestAttribute(true);
+
+ assertEquals(2.8f, orderAddress.getPrice());
+ assertEquals("ALLO", orderAddress.getCity());
+
+ OrderDetail orderDetail = Model1Factory.eINSTANCE.createOrderDetail();
+ resource.getContents().add(orderDetail);
+ orderDetail.setPrice(3f);
+
+ transaction.commit();
+
+ orderAddress.setCity("ALLO");
+
+ transaction.commit();
+ session.close();
+
+ session = openModel1Session();
+
+ msg("Opening transaction");
+ transaction = session.openTransaction();
+ orderAddress = (OrderAddress)transaction.getObject(orderAddress.cdoID(), true);
+
+ assertEquals(2.8f, orderAddress.getPrice());
+ assertEquals("ALLO", orderAddress.getCity());
+
+ orderAddress.setPrice(2.8f);
+ transaction.commit();
+ session.close();
+
+ session = openModel1Session();
+
+ transaction = session.openTransaction();
+ orderAddress = (OrderAddress)transaction.getObject(orderAddress.cdoID(), true);
+
+ assertEquals(2.8f, orderAddress.getPrice());
+ assertEquals("ALLO", orderAddress.getCity());
+
+ orderAddress.setPrice(2.8f);
+
+ session.close();
+ }
}