Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-11-03 07:45:24 +0000
committerEike Stepper2009-11-03 07:45:24 +0000
commita5d50f4b1bfd1db0bc6ebee44c6a974771ba7ef1 (patch)
treee996900b685df7b66836c2aa219bef3f4bff8162 /plugins/org.eclipse.emf.cdo.tests.model1
parentd440735b083340df353370ec59add81264ba1000 (diff)
downloadcdo-a5d50f4b1bfd1db0bc6ebee44c6a974771ba7ef1.tar.gz
cdo-a5d50f4b1bfd1db0bc6ebee44c6a974771ba7ef1.tar.xz
cdo-a5d50f4b1bfd1db0bc6ebee44c6a974771ba7ef1.zip
[282748] [Hibernate] Support (E)Map
https://bugs.eclipse.org/bugs/show_bug.cgi?id=282748
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.model1')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/model/model1.ecore6
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Customer.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Model1Package.java125
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/CustomerImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java66
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/ProductToOrderImpl.java206
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1AdapterFactory.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java25
9 files changed, 496 insertions, 2 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 1277a8de9c..53cc478d02 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.ecore
@@ -29,6 +29,8 @@
<eClassifiers xsi:type="ecore:EClass" name="Customer" eSuperTypes="#//Address">
<eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1"
eType="#//SalesOrder" eOpposite="#//SalesOrder/customer"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="orderByProduct" upperBound="-1"
+ eType="#//ProductToOrder" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Order">
<eAnnotations source="teneo.jpa">
@@ -84,4 +86,8 @@
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="testAttribute" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ProductToOrder" instanceClassName="java.util.Map$Entry">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="key" eType="#//Product1"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="value" eType="#//SalesOrder"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Customer.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Customer.java
index 6e0b3bdfa8..245b6075d1 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Customer.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Customer.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.tests.model1;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.EMap;
/**
* <!-- begin-user-doc --> A representation of the model object '<em><b>Customer</b></em>'. <!-- end-user-doc -->
@@ -18,6 +19,7 @@ import org.eclipse.emf.common.util.EList;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.emf.cdo.tests.model1.Customer#getSalesOrders <em>Sales Orders</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.Customer#getOrderByProduct <em>Order By Product</em>}</li>
* </ul>
* </p>
*
@@ -52,4 +54,21 @@ public interface Customer extends Address
*/
EList<SalesOrder> getSalesOrders();
+ /**
+ * Returns the value of the '<em><b>Order By Product</b></em>' map. The key is of type
+ * {@link org.eclipse.emf.cdo.tests.model1.Product1}, and the value is of type
+ * {@link org.eclipse.emf.cdo.tests.model1.SalesOrder}, <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Order By Product</em>' map isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Order By Product</em>' map.
+ * @see org.eclipse.emf.cdo.tests.model1.Model1Package#getCustomer_OrderByProduct()
+ * @model mapType="org.eclipse.emf.cdo.tests.model1.ProductToOrder<org.eclipse.emf.cdo.tests.model1.Product1, org.eclipse.emf.cdo.tests.model1.SalesOrder>"
+ * @generated
+ */
+ EMap<Product1, SalesOrder> getOrderByProduct();
+
} // Customer
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 8bbb129175..f7c581332a 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
@@ -371,12 +371,20 @@ public interface Model1Package extends EPackage
int CUSTOMER__SALES_ORDERS = ADDRESS_FEATURE_COUNT + 0;
/**
+ * The feature id for the '<em><b>Order By Product</b></em>' map. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CUSTOMER__ORDER_BY_PRODUCT = ADDRESS_FEATURE_COUNT + 1;
+
+ /**
* The number of structural features of the '<em>Customer</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- int CUSTOMER_FEATURE_COUNT = ADDRESS_FEATURE_COUNT + 1;
+ int CUSTOMER_FEATURE_COUNT = ADDRESS_FEATURE_COUNT + 2;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.tests.model1.impl.OrderImpl <em>Order</em>}' class. <!--
@@ -686,6 +694,41 @@ public interface Model1Package extends EPackage
int ORDER_ADDRESS_FEATURE_COUNT = ADDRESS_FEATURE_COUNT + 5;
/**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model1.impl.ProductToOrderImpl
+ * <em>Product To Order</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model1.impl.ProductToOrderImpl
+ * @see org.eclipse.emf.cdo.tests.model1.impl.Model1PackageImpl#getProductToOrder()
+ * @generated
+ */
+ int PRODUCT_TO_ORDER = 11;
+
+ /**
+ * The feature id for the '<em><b>Key</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PRODUCT_TO_ORDER__KEY = 0;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PRODUCT_TO_ORDER__VALUE = 1;
+
+ /**
+ * The number of structural features of the '<em>Product To Order</em>' class. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PRODUCT_TO_ORDER_FEATURE_COUNT = 2;
+
+ /**
* The meta object id for the '{@link org.eclipse.emf.cdo.tests.model1.VAT <em>VAT</em>}' enum. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
@@ -693,7 +736,7 @@ public interface Model1Package extends EPackage
* @see org.eclipse.emf.cdo.tests.model1.impl.Model1PackageImpl#getVAT()
* @generated
*/
- int VAT = 11;
+ int VAT = 12;
/**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model1.Supplier <em>Supplier</em>}'. <!--
@@ -824,6 +867,39 @@ public interface Model1Package extends EPackage
EAttribute getOrderAddress_TestAttribute();
/**
+ * Returns the meta object for class '{@link java.util.Map.Entry <em>Product To Order</em>}'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Product To Order</em>'.
+ * @see java.util.Map.Entry
+ * @model keyType="org.eclipse.emf.cdo.tests.model1.Product1" valueType="org.eclipse.emf.cdo.tests.model1.SalesOrder"
+ * @generated
+ */
+ EClass getProductToOrder();
+
+ /**
+ * Returns the meta object for the reference '{@link java.util.Map.Entry <em>Key</em>}'. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return the meta object for the reference '<em>Key</em>'.
+ * @see java.util.Map.Entry
+ * @see #getProductToOrder()
+ * @generated
+ */
+ EReference getProductToOrder_Key();
+
+ /**
+ * Returns the meta object for the reference '{@link java.util.Map.Entry <em>Value</em>}'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for the reference '<em>Value</em>'.
+ * @see java.util.Map.Entry
+ * @see #getProductToOrder()
+ * @generated
+ */
+ EReference getProductToOrder_Value();
+
+ /**
* Returns the meta object for enum '{@link org.eclipse.emf.cdo.tests.model1.VAT <em>VAT</em>}'. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
@@ -1024,6 +1100,17 @@ public interface Model1Package extends EPackage
EReference getCustomer_SalesOrders();
/**
+ * Returns the meta object for the map '{@link org.eclipse.emf.cdo.tests.model1.Customer#getOrderByProduct
+ * <em>Order By Product</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the map '<em>Order By Product</em>'.
+ * @see org.eclipse.emf.cdo.tests.model1.Customer#getOrderByProduct()
+ * @see #getCustomer()
+ * @generated
+ */
+ EReference getCustomer_OrderByProduct();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model1.Order <em>Order</em>}'. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
@@ -1238,6 +1325,32 @@ public interface Model1Package extends EPackage
EAttribute ORDER_ADDRESS__TEST_ATTRIBUTE = eINSTANCE.getOrderAddress_TestAttribute();
/**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model1.impl.ProductToOrderImpl
+ * <em>Product To Order</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model1.impl.ProductToOrderImpl
+ * @see org.eclipse.emf.cdo.tests.model1.impl.Model1PackageImpl#getProductToOrder()
+ * @generated
+ */
+ EClass PRODUCT_TO_ORDER = eINSTANCE.getProductToOrder();
+
+ /**
+ * The meta object literal for the '<em><b>Key</b></em>' reference feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EReference PRODUCT_TO_ORDER__KEY = eINSTANCE.getProductToOrder_Key();
+
+ /**
+ * The meta object literal for the '<em><b>Value</b></em>' reference feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EReference PRODUCT_TO_ORDER__VALUE = eINSTANCE.getProductToOrder_Value();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model1.VAT <em>VAT</em>}' enum. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
@@ -1392,6 +1505,14 @@ public interface Model1Package extends EPackage
EReference CUSTOMER__SALES_ORDERS = eINSTANCE.getCustomer_SalesOrders();
/**
+ * The meta object literal for the '<em><b>Order By Product</b></em>' map feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EReference CUSTOMER__ORDER_BY_PRODUCT = eINSTANCE.getCustomer_OrderByProduct();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model1.impl.OrderImpl <em>Order</em>}' class.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/CustomerImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/CustomerImpl.java
index 2e72138677..5a5ea35710 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/CustomerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/CustomerImpl.java
@@ -12,9 +12,11 @@ package org.eclipse.emf.cdo.tests.model1.impl;
import org.eclipse.emf.cdo.tests.model1.Customer;
import org.eclipse.emf.cdo.tests.model1.Model1Package;
+import org.eclipse.emf.cdo.tests.model1.Product1;
import org.eclipse.emf.cdo.tests.model1.SalesOrder;
import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.ecore.EClass;
/**
@@ -23,6 +25,7 @@ import org.eclipse.emf.ecore.EClass;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.cdo.tests.model1.impl.CustomerImpl#getSalesOrders <em>Sales Orders</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.impl.CustomerImpl#getOrderByProduct <em>Order By Product</em>}</li>
* </ul>
* </p>
*
@@ -69,4 +72,15 @@ public class CustomerImpl extends AddressImpl implements Customer
return (EList<SalesOrder>)eGet(Model1Package.Literals.CUSTOMER__SALES_ORDERS, true);
}
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EMap<Product1, SalesOrder> getOrderByProduct()
+ {
+ return (EMap<Product1, SalesOrder>)eGet(Model1Package.Literals.CUSTOMER__ORDER_BY_PRODUCT, true);
+ }
+
} // CustomerImpl
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 1fb3b6b5a0..5186e803bd 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
@@ -32,6 +32,8 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import java.util.Map;
+
/**
* <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc -->
*
@@ -111,6 +113,8 @@ public class Model1FactoryImpl extends EFactoryImpl implements Model1Factory
return createProduct1();
case Model1Package.ORDER_ADDRESS:
return createOrderAddress();
+ case Model1Package.PRODUCT_TO_ORDER:
+ return (EObject)createProductToOrder();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -210,6 +214,17 @@ public class Model1FactoryImpl extends EFactoryImpl implements Model1Factory
*
* @generated
*/
+ public Map.Entry<Product1, SalesOrder> createProductToOrder()
+ {
+ ProductToOrderImpl productToOrder = new ProductToOrderImpl();
+ return productToOrder;
+ }
+
+ /**
+ * <!-- 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 e000f4690a..f5510daac4 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
@@ -31,6 +31,8 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
+import java.util.Map;
+
/**
* <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
*
@@ -85,6 +87,13 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
*
* @generated
*/
+ private EClass productToOrderEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
private EEnum vatEEnum = null;
/**
@@ -357,6 +366,36 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
*
* @generated
*/
+ public EClass getProductToOrder()
+ {
+ return productToOrderEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EReference getProductToOrder_Key()
+ {
+ return (EReference)productToOrderEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EReference getProductToOrder_Value()
+ {
+ return (EReference)productToOrderEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public EEnum getVAT()
{
return vatEEnum;
@@ -537,6 +576,16 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
*
* @generated
*/
+ public EReference getCustomer_OrderByProduct()
+ {
+ return (EReference)customerEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public EClass getOrder()
{
return orderEClass;
@@ -630,6 +679,7 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
customerEClass = createEClass(CUSTOMER);
createEReference(customerEClass, CUSTOMER__SALES_ORDERS);
+ createEReference(customerEClass, CUSTOMER__ORDER_BY_PRODUCT);
orderEClass = createEClass(ORDER);
createEReference(orderEClass, ORDER__ORDER_DETAILS);
@@ -661,6 +711,10 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
orderAddressEClass = createEClass(ORDER_ADDRESS);
createEAttribute(orderAddressEClass, ORDER_ADDRESS__TEST_ATTRIBUTE);
+ productToOrderEClass = createEClass(PRODUCT_TO_ORDER);
+ createEReference(productToOrderEClass, PRODUCT_TO_ORDER__KEY);
+ createEReference(productToOrderEClass, PRODUCT_TO_ORDER__VALUE);
+
// Create enums
vatEEnum = createEEnum(VAT);
}
@@ -740,6 +794,9 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
initEReference(getCustomer_SalesOrders(), this.getSalesOrder(), this.getSalesOrder_Customer(), "salesOrders", null,
0, -1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCustomer_OrderByProduct(), this.getProductToOrder(), null, "orderByProduct", null, 0, -1,
+ Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
+ IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(orderEClass, Order.class, "Order", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getOrder_OrderDetails(), this.getOrderDetail(), this.getOrderDetail_Order(), "orderDetails", null,
@@ -800,6 +857,15 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
OrderAddress.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
+ initEClass(productToOrderEClass, Map.Entry.class, "ProductToOrder", !IS_ABSTRACT, !IS_INTERFACE,
+ !IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getProductToOrder_Key(), this.getProduct1(), null, "key", null, 0, 1, Map.Entry.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getProductToOrder_Value(), this.getSalesOrder(), null, "value", null, 0, 1, Map.Entry.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, 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/ProductToOrderImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/ProductToOrderImpl.java
new file mode 100644
index 0000000000..2b0825792b
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/ProductToOrderImpl.java
@@ -0,0 +1,206 @@
+/**
+ * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ *
+ * $Id: ProductToOrderImpl.java,v 1.1 2009-11-03 07:45:22 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.Product1;
+import org.eclipse.emf.cdo.tests.model1.SalesOrder;
+
+import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+
+import org.eclipse.emf.common.util.BasicEMap;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Product To Order</b></em>'. <!-- end-user-doc
+ * -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.impl.ProductToOrderImpl#getTypedKey <em>Key</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model1.impl.ProductToOrderImpl#getTypedValue <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ProductToOrderImpl extends CDOObjectImpl implements BasicEMap.Entry<Product1, SalesOrder>
+{
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final String copyright = "Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation";
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ProductToOrderImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return Model1Package.Literals.PRODUCT_TO_ORDER;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Product1 getTypedKey()
+ {
+ return (Product1)eGet(Model1Package.Literals.PRODUCT_TO_ORDER__KEY, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTypedKey(Product1 newKey)
+ {
+ eSet(Model1Package.Literals.PRODUCT_TO_ORDER__KEY, newKey);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public SalesOrder getTypedValue()
+ {
+ return (SalesOrder)eGet(Model1Package.Literals.PRODUCT_TO_ORDER__VALUE, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTypedValue(SalesOrder newValue)
+ {
+ eSet(Model1Package.Literals.PRODUCT_TO_ORDER__VALUE, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected int hash = -1;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public int getHash()
+ {
+ if (hash == -1)
+ {
+ Object theKey = getKey();
+ hash = (theKey == null ? 0 : theKey.hashCode());
+ }
+ return hash;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setHash(int hash)
+ {
+ this.hash = hash;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Product1 getKey()
+ {
+ return getTypedKey();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setKey(Product1 key)
+ {
+ setTypedKey(key);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public SalesOrder getValue()
+ {
+ return getTypedValue();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public SalesOrder setValue(SalesOrder value)
+ {
+ SalesOrder oldValue = getValue();
+ setTypedValue(value);
+ return oldValue;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EMap<Product1, SalesOrder> getEMap()
+ {
+ EObject container = eContainer();
+ return container == null ? null : (EMap<Product1, SalesOrder>)container.eGet(eContainmentFeature());
+ }
+
+} // ProductToOrderImpl
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 a3c3f38ae0..0fa50a46d2 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
@@ -28,6 +28,8 @@ import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
+import java.util.Map;
+
/**
* <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter <code>createXXX</code>
* method for each class of the model. <!-- end-user-doc -->
@@ -160,6 +162,12 @@ public class Model1AdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseProductToOrder(Map.Entry<Product1, SalesOrder> object)
+ {
+ return createProductToOrderAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object)
{
return createEObjectAdapter();
@@ -251,6 +259,20 @@ public class Model1AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link java.util.Map.Entry <em>Product To Order</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 java.util.Map.Entry
+ * @generated
+ */
+ public Adapter createProductToOrderAdapter()
+ {
+ 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 2521733aea..d9b126b650 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
@@ -27,6 +27,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import java.util.List;
+import java.util.Map;
/**
* <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the call
@@ -213,6 +214,15 @@ public class Model1Switch<T>
result = defaultCase(theEObject);
return result;
}
+ case Model1Package.PRODUCT_TO_ORDER:
+ {
+ @SuppressWarnings("unchecked")
+ Map.Entry<Product1, SalesOrder> productToOrder = (Map.Entry<Product1, SalesOrder>)theEObject;
+ T result = caseProductToOrder(productToOrder);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -294,6 +304,21 @@ public class Model1Switch<T>
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Product To Order</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>Product To Order</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseProductToOrder(Map.Entry<Product1, SalesOrder> 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 -->
*

Back to the top