diff options
author | Eike Stepper | 2009-12-26 09:46:14 +0000 |
---|---|---|
committer | Eike Stepper | 2009-12-26 09:46:14 +0000 |
commit | 44282fc620c618b3fed3a285fb659182e1c69acf (patch) | |
tree | f0e9b9fe467b66f8528110c0bac6197b49e39b52 /plugins/org.eclipse.emf.cdo.tests.model2 | |
parent | d506fbc61ec2ca783f319cfc2945f434d1a81c96 (diff) | |
download | cdo-44282fc620c618b3fed3a285fb659182e1c69acf.tar.gz cdo-44282fc620c618b3fed3a285fb659182e1c69acf.tar.xz cdo-44282fc620c618b3fed3a285fb659182e1c69acf.zip |
[298223] [CDO] Unable to delete an element from the model
https://bugs.eclipse.org/bugs/show_bug.cgi?id=298223
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.model2')
11 files changed, 633 insertions, 0 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 49d1ac01e9..78e7d0ae70 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore +++ b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore @@ -66,4 +66,12 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="unsettableVAT" eType="ecore:EEnum ../../org.eclipse.emf.cdo.tests.model1/model/model1.ecore#//VAT" defaultValueLiteral="VAT15" unsettable="true"/> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PersistentContainment"> + <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1" + eType="#//TransientContainer" containment="true" eOpposite="#//TransientContainer/parent"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="TransientContainer"> + <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//PersistentContainment" + eOpposite="#//PersistentContainment/children"/> + </eClassifiers> </ecore:EPackage> diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java index d2907bc69b..c90f407ede 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java @@ -69,6 +69,22 @@ public interface Model2Factory extends EFactory Unsettable2WithDefault createUnsettable2WithDefault(); /** + * Returns a new object of class '<em>Persistent Containment</em>'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return a new object of class '<em>Persistent Containment</em>'. + * @generated + */ + PersistentContainment createPersistentContainment(); + + /** + * Returns a new object of class '<em>Transient Container</em>'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return a new object of class '<em>Transient Container</em>'. + * @generated + */ + TransientContainer createTransientContainer(); + + /** * Returns the package supported by this factory. <!-- begin-user-doc --> <!-- end-user-doc --> * * @return the package supported by this factory. 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 1979116adc..57b3801a12 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 @@ -410,6 +410,61 @@ public interface Model2Package extends EPackage int UNSETTABLE2_WITH_DEFAULT_FEATURE_COUNT = 11; /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model2.impl.PersistentContainmentImpl + * <em>Persistent Containment</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see org.eclipse.emf.cdo.tests.model2.impl.PersistentContainmentImpl + * @see org.eclipse.emf.cdo.tests.model2.impl.Model2PackageImpl#getPersistentContainment() + * @generated + */ + int PERSISTENT_CONTAINMENT = 5; + + /** + * The feature id for the '<em><b>Children</b></em>' containment reference list. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @generated + * @ordered + */ + int PERSISTENT_CONTAINMENT__CHILDREN = 0; + + /** + * The number of structural features of the '<em>Persistent Containment</em>' class. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @generated + * @ordered + */ + int PERSISTENT_CONTAINMENT_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl + * <em>Transient Container</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl + * @see org.eclipse.emf.cdo.tests.model2.impl.Model2PackageImpl#getTransientContainer() + * @generated + */ + int TRANSIENT_CONTAINER = 6; + + /** + * The feature id for the '<em><b>Parent</b></em>' container reference. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int TRANSIENT_CONTAINER__PARENT = 0; + + /** + * The number of structural features of the '<em>Transient Container</em>' class. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @generated + * @ordered + */ + int TRANSIENT_CONTAINER_FEATURE_COUNT = 1; + + /** * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder * <em>Special Purchase Order</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> * @@ -782,6 +837,50 @@ public interface Model2Package extends EPackage EAttribute getUnsettable2WithDefault_UnsettableVAT(); /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.PersistentContainment + * <em>Persistent Containment</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for class '<em>Persistent Containment</em>'. + * @see org.eclipse.emf.cdo.tests.model2.PersistentContainment + * @generated + */ + EClass getPersistentContainment(); + + /** + * Returns the meta object for the containment reference list ' + * {@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getChildren <em>Children</em>}'. <!-- begin-user-doc + * --> <!-- end-user-doc --> + * + * @return the meta object for the containment reference list '<em>Children</em>'. + * @see org.eclipse.emf.cdo.tests.model2.PersistentContainment#getChildren() + * @see #getPersistentContainment() + * @generated + */ + EReference getPersistentContainment_Children(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.TransientContainer + * <em>Transient Container</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for class '<em>Transient Container</em>'. + * @see org.eclipse.emf.cdo.tests.model2.TransientContainer + * @generated + */ + EClass getTransientContainer(); + + /** + * Returns the meta object for the container reference ' + * {@link org.eclipse.emf.cdo.tests.model2.TransientContainer#getParent <em>Parent</em>}'. <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return the meta object for the container reference '<em>Parent</em>'. + * @see org.eclipse.emf.cdo.tests.model2.TransientContainer#getParent() + * @see #getTransientContainer() + * @generated + */ + EReference getTransientContainer_Parent(); + + /** * 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. @@ -1077,6 +1176,42 @@ public interface Model2Package extends EPackage */ EAttribute UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT = eINSTANCE.getUnsettable2WithDefault_UnsettableVAT(); + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model2.impl.PersistentContainmentImpl + * <em>Persistent Containment</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see org.eclipse.emf.cdo.tests.model2.impl.PersistentContainmentImpl + * @see org.eclipse.emf.cdo.tests.model2.impl.Model2PackageImpl#getPersistentContainment() + * @generated + */ + EClass PERSISTENT_CONTAINMENT = eINSTANCE.getPersistentContainment(); + + /** + * The meta object literal for the '<em><b>Children</b></em>' containment reference list feature. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EReference PERSISTENT_CONTAINMENT__CHILDREN = eINSTANCE.getPersistentContainment_Children(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl + * <em>Transient Container</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl + * @see org.eclipse.emf.cdo.tests.model2.impl.Model2PackageImpl#getTransientContainer() + * @generated + */ + EClass TRANSIENT_CONTAINER = eINSTANCE.getTransientContainer(); + + /** + * The meta object literal for the '<em><b>Parent</b></em>' container reference feature. <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + EReference TRANSIENT_CONTAINER__PARENT = eINSTANCE.getTransientContainer_Parent(); + } } // Model2Package diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/PersistentContainment.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/PersistentContainment.java new file mode 100644 index 0000000000..4b5fca87dd --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/PersistentContainment.java @@ -0,0 +1,50 @@ +/** + * 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 + */ +package org.eclipse.emf.cdo.tests.model2; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> A representation of the model object '<em><b>Persistent Containment</b></em>'. <!-- + * end-user-doc --> + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getChildren <em>Children</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getPersistentContainment() + * @model + * @generated + */ +public interface PersistentContainment extends EObject +{ + /** + * Returns the value of the '<em><b>Children</b></em>' containment reference list. The list contents are of type + * {@link org.eclipse.emf.cdo.tests.model2.TransientContainer}. It is bidirectional and its opposite is ' + * {@link org.eclipse.emf.cdo.tests.model2.TransientContainer#getParent <em>Parent</em>}'. <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Children</em>' containment reference list isn't clear, there really should be more of a + * description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Children</em>' containment reference list. + * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getPersistentContainment_Children() + * @see org.eclipse.emf.cdo.tests.model2.TransientContainer#getParent + * @model opposite="parent" containment="true" + * @generated + */ + EList<TransientContainer> getChildren(); + +} // PersistentContainment diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/TransientContainer.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/TransientContainer.java new file mode 100644 index 0000000000..3cbc2e2ce9 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/TransientContainer.java @@ -0,0 +1,61 @@ +/** + * 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 + */ +package org.eclipse.emf.cdo.tests.model2; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> A representation of the model object '<em><b>Transient Container</b></em>'. <!-- end-user-doc + * --> + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.cdo.tests.model2.TransientContainer#getParent <em>Parent</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTransientContainer() + * @model + * @generated + */ +public interface TransientContainer extends EObject +{ + /** + * Returns the value of the '<em><b>Parent</b></em>' container reference. It is bidirectional and its opposite is ' + * {@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getChildren <em>Children</em>}'. <!-- begin-user-doc + * --> + * <p> + * If the meaning of the '<em>Parent</em>' container reference isn't clear, there really should be more of a + * description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Parent</em>' container reference. + * @see #setParent(PersistentContainment) + * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTransientContainer_Parent() + * @see org.eclipse.emf.cdo.tests.model2.PersistentContainment#getChildren + * @model opposite="children" transient="false" + * @generated + */ + PersistentContainment getParent(); + + /** + * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.TransientContainer#getParent <em>Parent</em>}' + * container reference. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @param value + * the new value of the '<em>Parent</em>' container reference. + * @see #getParent() + * @generated + */ + void setParent(PersistentContainment value); + +} // TransientContainer diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java index 7ed012f6b6..5cb3d1fb9d 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java @@ -12,9 +12,11 @@ package org.eclipse.emf.cdo.tests.model2.impl; import org.eclipse.emf.cdo.tests.model2.Model2Factory; import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; import org.eclipse.emf.cdo.tests.model2.Task; import org.eclipse.emf.cdo.tests.model2.TaskContainer; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; import org.eclipse.emf.cdo.tests.model2.Unsettable1; import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; @@ -84,6 +86,10 @@ public class Model2FactoryImpl extends EFactoryImpl implements Model2Factory return createUnsettable1(); case Model2Package.UNSETTABLE2_WITH_DEFAULT: return createUnsettable2WithDefault(); + case Model2Package.PERSISTENT_CONTAINMENT: + return createPersistentContainment(); + case Model2Package.TRANSIENT_CONTAINER: + return createTransientContainer(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -149,6 +155,28 @@ public class Model2FactoryImpl extends EFactoryImpl implements Model2Factory * * @generated */ + public PersistentContainment createPersistentContainment() + { + PersistentContainmentImpl persistentContainment = new PersistentContainmentImpl(); + return persistentContainment; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public TransientContainer createTransientContainer() + { + TransientContainerImpl transientContainer = new TransientContainerImpl(); + return transientContainer; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ public Model2Package getModel2Package() { return (Model2Package)getEPackage(); 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 8c409e8b74..91ab40086f 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 @@ -13,9 +13,11 @@ package org.eclipse.emf.cdo.tests.model2.impl; import org.eclipse.emf.cdo.tests.model1.Model1Package; import org.eclipse.emf.cdo.tests.model2.Model2Factory; import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; import org.eclipse.emf.cdo.tests.model2.Task; import org.eclipse.emf.cdo.tests.model2.TaskContainer; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; import org.eclipse.emf.cdo.tests.model2.Unsettable1; import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; @@ -68,6 +70,20 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package private EClass unsettable2WithDefaultEClass = null; /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + private EClass persistentContainmentEClass = null; + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + private EClass transientContainerEClass = null; + + /** * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry * EPackage.Registry} by the package package URI value. * <p> @@ -468,6 +484,46 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package * * @generated */ + public EClass getPersistentContainment() + { + return persistentContainmentEClass; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public EReference getPersistentContainment_Children() + { + return (EReference)persistentContainmentEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public EClass getTransientContainer() + { + return transientContainerEClass; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public EReference getTransientContainer_Parent() + { + return (EReference)transientContainerEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ public Model2Factory getModel2Factory() { return (Model2Factory)getEFactoryInstance(); @@ -530,6 +586,12 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_SHORT); createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_STRING); createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT); + + persistentContainmentEClass = createEClass(PERSISTENT_CONTAINMENT); + createEReference(persistentContainmentEClass, PERSISTENT_CONTAINMENT__CHILDREN); + + transientContainerEClass = createEClass(TRANSIENT_CONTAINER); + createEReference(transientContainerEClass, TRANSIENT_CONTAINER__PARENT); } /** @@ -663,6 +725,20 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package 1, Unsettable2WithDefault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(persistentContainmentEClass, PersistentContainment.class, "PersistentContainment", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPersistentContainment_Children(), this.getTransientContainer(), this + .getTransientContainer_Parent(), "children", null, 0, -1, PersistentContainment.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + + initEClass(transientContainerEClass, TransientContainer.class, "TransientContainer", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getTransientContainer_Parent(), this.getPersistentContainment(), this + .getPersistentContainment_Children(), "parent", null, 0, 1, TransientContainer.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/PersistentContainmentImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/PersistentContainmentImpl.java new file mode 100644 index 0000000000..cee05e6f6a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/PersistentContainmentImpl.java @@ -0,0 +1,79 @@ +/** + * 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 + */ +package org.eclipse.emf.cdo.tests.model2.impl; + +import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; + +import org.eclipse.emf.internal.cdo.CDOObjectImpl; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Persistent Containment</b></em>'. <!-- + * end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.PersistentContainmentImpl#getChildren <em>Children</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class PersistentContainmentImpl extends CDOObjectImpl implements PersistentContainment +{ + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + protected PersistentContainmentImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.PERSISTENT_CONTAINMENT; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + protected int eStaticFeatureCount() + { + return 0; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @SuppressWarnings("unchecked") + public EList<TransientContainer> getChildren() + { + return (EList<TransientContainer>)eGet(Model2Package.Literals.PERSISTENT_CONTAINMENT__CHILDREN, true); + } + +} // PersistentContainmentImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TransientContainerImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TransientContainerImpl.java new file mode 100644 index 0000000000..a0cad6269a --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TransientContainerImpl.java @@ -0,0 +1,87 @@ +/** + * 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 + */ +package org.eclipse.emf.cdo.tests.model2.impl; + +import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; + +import org.eclipse.emf.internal.cdo.CDOObjectImpl; + +import org.eclipse.emf.ecore.EClass; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Transient Container</b></em>'. <!-- + * end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl#getParent <em>Parent</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class TransientContainerImpl extends CDOObjectImpl implements TransientContainer +{ + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + protected TransientContainerImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return Model2Package.Literals.TRANSIENT_CONTAINER; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + protected int eStaticFeatureCount() + { + return 0; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public PersistentContainment getParent() + { + return (PersistentContainment)eGet(Model2Package.Literals.TRANSIENT_CONTAINER__PARENT, true); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public void setParent(PersistentContainment newParent) + { + eSet(Model2Package.Literals.TRANSIENT_CONTAINER__PARENT, newParent); + } + +} // TransientContainerImpl diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java index e3e086af93..479d56c388 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java @@ -13,9 +13,11 @@ package org.eclipse.emf.cdo.tests.model2.util; import org.eclipse.emf.cdo.tests.model1.Order; import org.eclipse.emf.cdo.tests.model1.PurchaseOrder; import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; import org.eclipse.emf.cdo.tests.model2.Task; import org.eclipse.emf.cdo.tests.model2.TaskContainer; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; import org.eclipse.emf.cdo.tests.model2.Unsettable1; import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; @@ -113,6 +115,18 @@ public class Model2AdapterFactory extends AdapterFactoryImpl } @Override + public Adapter casePersistentContainment(PersistentContainment object) + { + return createPersistentContainmentAdapter(); + } + + @Override + public Adapter caseTransientContainer(TransientContainer object) + { + return createTransientContainerAdapter(); + } + + @Override public Adapter caseOrder(Order object) { return createOrderAdapter(); @@ -218,6 +232,36 @@ public class Model2AdapterFactory extends AdapterFactoryImpl } /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model2.PersistentContainment + * <em>Persistent Containment</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.model2.PersistentContainment + * @generated + */ + public Adapter createPersistentContainmentAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model2.TransientContainer + * <em>Transient Container</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.model2.TransientContainer + * @generated + */ + public Adapter createTransientContainerAdapter() + { + return null; + } + + /** * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model1.Order <em>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 --> diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java index 0d90e10c17..da386f0116 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java +++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java @@ -13,9 +13,11 @@ package org.eclipse.emf.cdo.tests.model2.util; import org.eclipse.emf.cdo.tests.model1.Order; import org.eclipse.emf.cdo.tests.model1.PurchaseOrder; import org.eclipse.emf.cdo.tests.model2.Model2Package; +import org.eclipse.emf.cdo.tests.model2.PersistentContainment; import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder; import org.eclipse.emf.cdo.tests.model2.Task; import org.eclipse.emf.cdo.tests.model2.TaskContainer; +import org.eclipse.emf.cdo.tests.model2.TransientContainer; import org.eclipse.emf.cdo.tests.model2.Unsettable1; import org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault; @@ -142,6 +144,22 @@ public class Model2Switch<T> result = defaultCase(theEObject); return result; } + case Model2Package.PERSISTENT_CONTAINMENT: + { + PersistentContainment persistentContainment = (PersistentContainment)theEObject; + T result = casePersistentContainment(persistentContainment); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case Model2Package.TRANSIENT_CONTAINER: + { + TransientContainer transientContainer = (TransientContainer)theEObject; + T result = caseTransientContainer(transientContainer); + if (result == null) + result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } @@ -225,6 +243,37 @@ public class Model2Switch<T> } /** + * Returns the result of interpreting the object as an instance of '<em>Persistent Containment</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>Persistent Containment</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePersistentContainment(PersistentContainment object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Transient Container</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>Transient Container</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTransientContainer(TransientContainer object) + { + return null; + } + + /** * Returns the result of interpreting the object as an instance of '<em>Order</em>'. <!-- begin-user-doc --> This * implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> * |