Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore11
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java119
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/PersistentContainment.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/TransientContainer.java56
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java64
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/PersistentContainmentImpl.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TransientContainerImpl.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/kdm-1.0.ecore60
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java78
9 files changed, 517 insertions, 13 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 78e7d0ae70..3e775a5875 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
@@ -67,11 +67,16 @@
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"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="attrBefore" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="children" ordered="false"
+ upperBound="-1" eType="#//TransientContainer" containment="true" resolveProxies="false"
+ eOpposite="#//TransientContainer/parent"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="attrAfter" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TransientContainer">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="attrBefore" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//PersistentContainment"
- eOpposite="#//PersistentContainment/children"/>
+ transient="true" eOpposite="#//PersistentContainment/children"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="attrAfter" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</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 57b3801a12..27568648d2 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
@@ -420,13 +420,29 @@ public interface Model2Package extends EPackage
int PERSISTENT_CONTAINMENT = 5;
/**
+ * The feature id for the '<em><b>Attr Before</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PERSISTENT_CONTAINMENT__ATTR_BEFORE = 0;
+
+ /**
* 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;
+ int PERSISTENT_CONTAINMENT__CHILDREN = 1;
+
+ /**
+ * The feature id for the '<em><b>Attr After</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PERSISTENT_CONTAINMENT__ATTR_AFTER = 2;
/**
* The number of structural features of the '<em>Persistent Containment</em>' class. <!-- begin-user-doc --> <!--
@@ -435,7 +451,7 @@ public interface Model2Package extends EPackage
* @generated
* @ordered
*/
- int PERSISTENT_CONTAINMENT_FEATURE_COUNT = 1;
+ int PERSISTENT_CONTAINMENT_FEATURE_COUNT = 3;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl
@@ -448,12 +464,28 @@ public interface Model2Package extends EPackage
int TRANSIENT_CONTAINER = 6;
/**
+ * The feature id for the '<em><b>Attr Before</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TRANSIENT_CONTAINER__ATTR_BEFORE = 0;
+
+ /**
* 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;
+ int TRANSIENT_CONTAINER__PARENT = 1;
+
+ /**
+ * The feature id for the '<em><b>Attr After</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TRANSIENT_CONTAINER__ATTR_AFTER = 2;
/**
* The number of structural features of the '<em>Transient Container</em>' class. <!-- begin-user-doc --> <!--
@@ -462,7 +494,7 @@ public interface Model2Package extends EPackage
* @generated
* @ordered
*/
- int TRANSIENT_CONTAINER_FEATURE_COUNT = 1;
+ int TRANSIENT_CONTAINER_FEATURE_COUNT = 3;
/**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder
@@ -847,6 +879,18 @@ public interface Model2Package extends EPackage
EClass getPersistentContainment();
/**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getAttrBefore <em>Attr Before</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Attr Before</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.PersistentContainment#getAttrBefore()
+ * @see #getPersistentContainment()
+ * @generated
+ */
+ EAttribute getPersistentContainment_AttrBefore();
+
+ /**
* 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 -->
@@ -859,6 +903,18 @@ public interface Model2Package extends EPackage
EReference getPersistentContainment_Children();
/**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getAttrAfter <em>Attr After</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Attr After</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.PersistentContainment#getAttrAfter()
+ * @see #getPersistentContainment()
+ * @generated
+ */
+ EAttribute getPersistentContainment_AttrAfter();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.TransientContainer
* <em>Transient Container</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -869,6 +925,18 @@ public interface Model2Package extends EPackage
EClass getTransientContainer();
/**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.emf.cdo.tests.model2.TransientContainer#getAttrBefore <em>Attr Before</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Attr Before</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.TransientContainer#getAttrBefore()
+ * @see #getTransientContainer()
+ * @generated
+ */
+ EAttribute getTransientContainer_AttrBefore();
+
+ /**
* 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 -->
@@ -881,6 +949,17 @@ public interface Model2Package extends EPackage
EReference getTransientContainer_Parent();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.model2.TransientContainer#getAttrAfter
+ * <em>Attr After</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Attr After</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.TransientContainer#getAttrAfter()
+ * @see #getTransientContainer()
+ * @generated
+ */
+ EAttribute getTransientContainer_AttrAfter();
+
+ /**
* 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.
@@ -1187,6 +1266,14 @@ public interface Model2Package extends EPackage
EClass PERSISTENT_CONTAINMENT = eINSTANCE.getPersistentContainment();
/**
+ * The meta object literal for the '<em><b>Attr Before</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute PERSISTENT_CONTAINMENT__ATTR_BEFORE = eINSTANCE.getPersistentContainment_AttrBefore();
+
+ /**
* The meta object literal for the '<em><b>Children</b></em>' containment reference list feature. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
@@ -1195,6 +1282,14 @@ public interface Model2Package extends EPackage
EReference PERSISTENT_CONTAINMENT__CHILDREN = eINSTANCE.getPersistentContainment_Children();
/**
+ * The meta object literal for the '<em><b>Attr After</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute PERSISTENT_CONTAINMENT__ATTR_AFTER = eINSTANCE.getPersistentContainment_AttrAfter();
+
+ /**
* 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 -->
*
@@ -1205,6 +1300,14 @@ public interface Model2Package extends EPackage
EClass TRANSIENT_CONTAINER = eINSTANCE.getTransientContainer();
/**
+ * The meta object literal for the '<em><b>Attr Before</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute TRANSIENT_CONTAINER__ATTR_BEFORE = eINSTANCE.getTransientContainer_AttrBefore();
+
+ /**
* The meta object literal for the '<em><b>Parent</b></em>' container reference feature. <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
@@ -1212,6 +1315,14 @@ public interface Model2Package extends EPackage
*/
EReference TRANSIENT_CONTAINER__PARENT = eINSTANCE.getTransientContainer_Parent();
+ /**
+ * The meta object literal for the '<em><b>Attr After</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute TRANSIENT_CONTAINER__ATTR_AFTER = eINSTANCE.getTransientContainer_AttrAfter();
+
}
} // 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
index 4b5fca87dd..fc5de8bab9 100644
--- 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
@@ -19,7 +19,9 @@ import org.eclipse.emf.ecore.EObject;
* <p>
* The following features are supported:
* <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getAttrBefore <em>Attr Before</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getChildren <em>Children</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getAttrAfter <em>Attr After</em>}</li>
* </ul>
* </p>
*
@@ -30,6 +32,33 @@ import org.eclipse.emf.ecore.EObject;
public interface PersistentContainment extends EObject
{
/**
+ * Returns the value of the '<em><b>Attr Before</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Attr Before</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Attr Before</em>' attribute.
+ * @see #setAttrBefore(String)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getPersistentContainment_AttrBefore()
+ * @model
+ * @generated
+ */
+ String getAttrBefore();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getAttrBefore
+ * <em>Attr Before</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Attr Before</em>' attribute.
+ * @see #getAttrBefore()
+ * @generated
+ */
+ void setAttrBefore(String value);
+
+ /**
* 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 -->
@@ -42,9 +71,36 @@ public interface PersistentContainment extends EObject
* @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"
+ * @model opposite="parent" containment="true" ordered="false"
* @generated
*/
EList<TransientContainer> getChildren();
+ /**
+ * Returns the value of the '<em><b>Attr After</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Attr After</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Attr After</em>' attribute.
+ * @see #setAttrAfter(String)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getPersistentContainment_AttrAfter()
+ * @model
+ * @generated
+ */
+ String getAttrAfter();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.PersistentContainment#getAttrAfter
+ * <em>Attr After</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Attr After</em>' attribute.
+ * @see #getAttrAfter()
+ * @generated
+ */
+ void setAttrAfter(String value);
+
} // 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
index 3cbc2e2ce9..d68910a662 100644
--- 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
@@ -29,6 +29,33 @@ import org.eclipse.emf.ecore.EObject;
public interface TransientContainer extends EObject
{
/**
+ * Returns the value of the '<em><b>Attr Before</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Attr Before</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Attr Before</em>' attribute.
+ * @see #setAttrBefore(String)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTransientContainer_AttrBefore()
+ * @model
+ * @generated
+ */
+ String getAttrBefore();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.TransientContainer#getAttrBefore
+ * <em>Attr Before</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Attr Before</em>' attribute.
+ * @see #getAttrBefore()
+ * @generated
+ */
+ void setAttrBefore(String value);
+
+ /**
* 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
* -->
@@ -42,7 +69,7 @@ public interface TransientContainer extends EObject
* @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"
+ * @model opposite="children"
* @generated
*/
PersistentContainment getParent();
@@ -58,4 +85,31 @@ public interface TransientContainer extends EObject
*/
void setParent(PersistentContainment value);
+ /**
+ * Returns the value of the '<em><b>Attr After</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Attr After</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Attr After</em>' attribute.
+ * @see #setAttrAfter(String)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTransientContainer_AttrAfter()
+ * @model
+ * @generated
+ */
+ String getAttrAfter();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.TransientContainer#getAttrAfter <em>Attr After</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Attr After</em>' attribute.
+ * @see #getAttrAfter()
+ * @generated
+ */
+ void setAttrAfter(String value);
+
} // TransientContainer
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 91ab40086f..7005f7a147 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
@@ -494,9 +494,29 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
*
* @generated
*/
+ public EAttribute getPersistentContainment_AttrBefore()
+ {
+ return (EAttribute)persistentContainmentEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public EReference getPersistentContainment_Children()
{
- return (EReference)persistentContainmentEClass.getEStructuralFeatures().get(0);
+ return (EReference)persistentContainmentEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getPersistentContainment_AttrAfter()
+ {
+ return (EAttribute)persistentContainmentEClass.getEStructuralFeatures().get(2);
}
/**
@@ -514,9 +534,29 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
*
* @generated
*/
+ public EAttribute getTransientContainer_AttrBefore()
+ {
+ return (EAttribute)transientContainerEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public EReference getTransientContainer_Parent()
{
- return (EReference)transientContainerEClass.getEStructuralFeatures().get(0);
+ return (EReference)transientContainerEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getTransientContainer_AttrAfter()
+ {
+ return (EAttribute)transientContainerEClass.getEStructuralFeatures().get(2);
}
/**
@@ -588,10 +628,14 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_VAT);
persistentContainmentEClass = createEClass(PERSISTENT_CONTAINMENT);
+ createEAttribute(persistentContainmentEClass, PERSISTENT_CONTAINMENT__ATTR_BEFORE);
createEReference(persistentContainmentEClass, PERSISTENT_CONTAINMENT__CHILDREN);
+ createEAttribute(persistentContainmentEClass, PERSISTENT_CONTAINMENT__ATTR_AFTER);
transientContainerEClass = createEClass(TRANSIENT_CONTAINER);
+ createEAttribute(transientContainerEClass, TRANSIENT_CONTAINER__ATTR_BEFORE);
createEReference(transientContainerEClass, TRANSIENT_CONTAINER__PARENT);
+ createEAttribute(transientContainerEClass, TRANSIENT_CONTAINER__ATTR_AFTER);
}
/**
@@ -727,17 +771,29 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
initEClass(persistentContainmentEClass, PersistentContainment.class, "PersistentContainment", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPersistentContainment_AttrBefore(), ecorePackage.getEString(), "attrBefore", null, 0, 1,
+ PersistentContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
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);
+ !IS_ORDERED);
+ initEAttribute(getPersistentContainment_AttrAfter(), ecorePackage.getEString(), "attrAfter", null, 0, 1,
+ PersistentContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
initEClass(transientContainerEClass, TransientContainer.class, "TransientContainer", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getTransientContainer_AttrBefore(), ecorePackage.getEString(), "attrBefore", null, 0, 1,
+ TransientContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
initEReference(getTransientContainer_Parent(), this.getPersistentContainment(), this
- .getPersistentContainment_Children(), "parent", null, 0, 1, TransientContainer.class, !IS_TRANSIENT,
+ .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);
+ initEAttribute(getTransientContainer_AttrAfter(), ecorePackage.getEString(), "attrAfter", null, 0, 1,
+ TransientContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, 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
index cee05e6f6a..709dfbbf6b 100644
--- 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
@@ -25,7 +25,9 @@ import org.eclipse.emf.ecore.EClass;
* <p>
* The following features are implemented:
* <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.PersistentContainmentImpl#getAttrBefore <em>Attr Before</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.impl.PersistentContainmentImpl#getChildren <em>Children</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.PersistentContainmentImpl#getAttrAfter <em>Attr After</em>}</li>
* </ul>
* </p>
*
@@ -70,10 +72,50 @@ public class PersistentContainmentImpl extends CDOObjectImpl implements Persiste
*
* @generated
*/
+ public String getAttrBefore()
+ {
+ return (String)eGet(Model2Package.Literals.PERSISTENT_CONTAINMENT__ATTR_BEFORE, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setAttrBefore(String newAttrBefore)
+ {
+ eSet(Model2Package.Literals.PERSISTENT_CONTAINMENT__ATTR_BEFORE, newAttrBefore);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
@SuppressWarnings("unchecked")
public EList<TransientContainer> getChildren()
{
return (EList<TransientContainer>)eGet(Model2Package.Literals.PERSISTENT_CONTAINMENT__CHILDREN, true);
}
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getAttrAfter()
+ {
+ return (String)eGet(Model2Package.Literals.PERSISTENT_CONTAINMENT__ATTR_AFTER, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setAttrAfter(String newAttrAfter)
+ {
+ eSet(Model2Package.Literals.PERSISTENT_CONTAINMENT__ATTR_AFTER, newAttrAfter);
+ }
+
} // 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
index a0cad6269a..2763741b1c 100644
--- 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
@@ -24,7 +24,9 @@ import org.eclipse.emf.ecore.EClass;
* <p>
* The following features are implemented:
* <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl#getAttrBefore <em>Attr Before</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl#getParent <em>Parent</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.TransientContainerImpl#getAttrAfter <em>Attr After</em>}</li>
* </ul>
* </p>
*
@@ -69,6 +71,26 @@ public class TransientContainerImpl extends CDOObjectImpl implements TransientCo
*
* @generated
*/
+ public String getAttrBefore()
+ {
+ return (String)eGet(Model2Package.Literals.TRANSIENT_CONTAINER__ATTR_BEFORE, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setAttrBefore(String newAttrBefore)
+ {
+ eSet(Model2Package.Literals.TRANSIENT_CONTAINER__ATTR_BEFORE, newAttrBefore);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public PersistentContainment getParent()
{
return (PersistentContainment)eGet(Model2Package.Literals.TRANSIENT_CONTAINER__PARENT, true);
@@ -84,4 +106,24 @@ public class TransientContainerImpl extends CDOObjectImpl implements TransientCo
eSet(Model2Package.Literals.TRANSIENT_CONTAINER__PARENT, newParent);
}
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getAttrAfter()
+ {
+ return (String)eGet(Model2Package.Literals.TRANSIENT_CONTAINER__ATTR_AFTER, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setAttrAfter(String newAttrAfter)
+ {
+ eSet(Model2Package.Literals.TRANSIENT_CONTAINER__ATTR_AFTER, newAttrAfter);
+ }
+
} // TransientContainerImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/kdm-1.0.ecore b/plugins/org.eclipse.emf.cdo.tests/src/kdm-1.0.ecore
new file mode 100644
index 0000000000..59eb93ee2a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/kdm-1.0.ecore
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="kdm"
+ nsURI="http://kdm.castortech.com/spec/KDM/1.0" nsPrefix="kdm">
+ <eSubpackages name="core" nsURI="http://kdm.castortech.com/spec/KDM/1.0/core" nsPrefix="core">
+ <eClassifiers xsi:type="ecore:EClass" name="Element" abstract="true">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="attribute" ordered="false"
+ upperBound="-1" eType="#//kdm/Attribute" containment="true" resolveProxies="false"
+ eOpposite="#//kdm/Attribute/elementOwner"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="uuid" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral=""/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ModelElement" abstract="true" interface="true"
+ eSuperTypes="#//core/Element"/>
+ <eClassifiers xsi:type="ecore:EClass" name="KDMEntity" abstract="true" eSuperTypes="#//core/ModelElement">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="#//core/String"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="String" instanceClassName="java.lang.String"/>
+ <eClassifiers xsi:type="ecore:EDataType" name="Integer" instanceClassName="java.lang.Integer"/>
+ <eClassifiers xsi:type="ecore:EDataType" name="Boolean" instanceClassName="java.lang.Boolean"/>
+ </eSubpackages>
+ <eSubpackages name="kdm" nsURI="http://kdm.castortech.com/spec/KDM/1.0/kdm" nsPrefix="kdm">
+ <eClassifiers xsi:type="ecore:EClass" name="KDMFramework" abstract="true" interface="true"
+ eSuperTypes="#//core/ModelElement">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="audit" ordered="false"
+ upperBound="-1" eType="#//kdm/Audit" containment="true" resolveProxies="false"
+ eOpposite="#//kdm/Audit/framework"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="#//core/String"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="KDMModel" abstract="true" interface="true"
+ eSuperTypes="#//kdm/KDMFramework">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="segment" ordered="false"
+ lowerBound="1" eType="#//kdm/Segment" transient="true" eOpposite="#//kdm/Segment/model"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Audit" eSuperTypes="#//core/Element">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="#//core/String"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="author" eType="#//core/String"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="date" eType="#//core/String"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="framework" ordered="false"
+ lowerBound="1" eType="#//kdm/KDMFramework" transient="true" eOpposite="#//kdm/KDMFramework/audit"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Segment" eSuperTypes="#//kdm/KDMFramework">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="segment" ordered="false"
+ upperBound="-1" eType="#//kdm/Segment" containment="true" resolveProxies="false"
+ eOpposite="#//kdm/Segment/segmentOwner"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="model" ordered="false"
+ upperBound="-1" eType="#//kdm/KDMModel" containment="true" resolveProxies="false"
+ eOpposite="#//kdm/KDMModel/segment"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="segmentOwner" ordered="false"
+ eType="#//kdm/Segment" transient="true" eOpposite="#//kdm/Segment/segment"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Attribute" eSuperTypes="#//core/Element">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="tag" eType="#//core/String"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="#//core/String"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="elementOwner" ordered="false"
+ eType="#//core/Element" transient="true" eOpposite="#//core/Element/attribute"/>
+ </eClassifiers>
+ </eSubpackages>
+</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
index ae49769f61..163810be5c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
@@ -17,9 +17,11 @@ import org.eclipse.emf.cdo.tests.model1.Category;
import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.tests.model1.Order;
import org.eclipse.emf.cdo.tests.model1.Supplier;
+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.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOUtil;
@@ -503,6 +505,82 @@ public class ContainmentTest extends AbstractCDOTest
session.close();
}
+ public void testModeledBackPointer_Transient() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource("/resource1");
+
+ PersistentContainment parent1 = createPersistentContainment();
+ parent1.getChildren().add(createTransientContainer());
+ parent1.getChildren().add(createTransientContainer());
+ parent1.getChildren().add(createTransientContainer());
+ resource.getContents().add(parent1);
+ transaction.commit();
+
+ // Move child
+ PersistentContainment parent2 = createPersistentContainment();
+ parent2.getChildren().add(parent1.getChildren().get(0));
+ transaction.commit();
+
+ // Remove child
+ parent1.getChildren().remove(0);
+ transaction.commit();
+
+ // Remove child
+ parent1.getChildren().remove(0);
+ transaction.commit();
+ }
+
+ public void testModeledBackPointer_Transient_Load() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource("/resource1");
+
+ PersistentContainment parent1 = createPersistentContainment();
+ parent1.getChildren().add(createTransientContainer());
+ parent1.getChildren().add(createTransientContainer());
+ parent1.getChildren().add(createTransientContainer());
+ resource.getContents().add(parent1);
+ transaction.commit();
+
+ session.close();
+ session = openSession();
+ transaction = session.openTransaction();
+ resource = transaction.getResource("/resource1");
+ parent1 = (PersistentContainment)resource.getContents().get(0);
+
+ // Move child
+ PersistentContainment parent2 = createPersistentContainment();
+ parent2.getChildren().add(parent1.getChildren().get(0));
+ transaction.commit();
+
+ // Remove child
+ parent1.getChildren().remove(0);
+ transaction.commit();
+
+ // Remove child
+ parent1.getChildren().remove(0);
+ transaction.commit();
+ }
+
+ private PersistentContainment createPersistentContainment()
+ {
+ PersistentContainment result = getModel2Factory().createPersistentContainment();
+ result.setAttrBefore("BEFORE");
+ result.setAttrAfter("AFTER");
+ return result;
+ }
+
+ private TransientContainer createTransientContainer()
+ {
+ TransientContainer result = getModel2Factory().createTransientContainer();
+ result.setAttrBefore("BEFORE");
+ result.setAttrAfter("AFTER");
+ return result;
+ }
+
// TODO Revisit me
// Do not support legacy system
public void _testBug246540() throws Exception

Back to the top