Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-01-06 16:12:41 +0000
committerEike Stepper2018-01-06 16:12:41 +0000
commit1ec6ab4762a0c39feca3b37ec3a7f76faf545d65 (patch)
tree1bee586fdb752026a7fbd50022511d4ce5194607
parent14d63d828cbf9cc5b72745cc71e12d988caad2fd (diff)
downloadcdo-1ec6ab4762a0c39feca3b37ec3a7f76faf545d65.tar.gz
cdo-1ec6ab4762a0c39feca3b37ec3a7f76faf545d65.tar.xz
cdo-1ec6ab4762a0c39feca3b37ec3a7f76faf545d65.zip
[528129] Transient objects are attached to CDOTransaction
https://bugs.eclipse.org/bugs/show_bug.cgi?id=528129
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/model/model3.ecore249
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel7
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/model/model3.legacy.genmodel7
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/ClassWithTransientContainment.java140
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java139
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/ClassWithTransientContainmentImpl.java146
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Factory.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Package.java139
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/ClassWithTransientContainmentImpl.java462
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3FactoryImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3PackageImpl.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3AdapterFactory.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3Switch.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_528129_Test.java208
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java44
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java82
22 files changed, 1767 insertions, 186 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.ecore b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.ecore
index 11f0a163fa..12dc6cd66d 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.ecore
@@ -1,119 +1,130 @@
-<?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="model3" nsURI="http://www.eclipse.org/emf/CDO/tests/model3/1.0.0"
- nsPrefix="model3">
- <eClassifiers xsi:type="ecore:EClass" name="Class1">
- <eStructuralFeatures xsi:type="ecore:EReference" name="class2" upperBound="-1"
- eType="#//subpackage/Class2" unsettable="true" eOpposite="#//subpackage/Class2/class1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MetaRef">
- <eStructuralFeatures xsi:type="ecore:EReference" name="ePackageRef" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EPackage"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="eClassRef" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EClass"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="eReferenceRef" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EReference"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="Point" instanceClassName="org.eclipse.emf.cdo.tests.model3.Point">
- <eAnnotations source="teneo.jpa">
- <details key="value" value="@NoAuditing"/>
- </eAnnotations>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Polygon">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="points" lowerBound="1"
- upperBound="-1" eType="#//Point"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="PolygonWithDuplicates">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="points" unique="false"
- lowerBound="1" upperBound="-1" eType="#//Point"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="NodeA">
- <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
- eType="#//NodeA" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="otherNodes" upperBound="-1"
- eType="#//NodeA"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="NodeB">
- <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
- eType="#//NodeB" containment="true" eOpposite="#//NodeB/parent"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//NodeB"
- eOpposite="#//NodeB/children"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="NodeC">
- <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
- eType="#//NodeC" containment="true" eOpposite="#//NodeC/parent"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//NodeC"
- eOpposite="#//NodeC/children"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="otherNodes" upperBound="-1"
- eType="#//NodeC" eOpposite="#//NodeC/oppositeNodes"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="oppositeNodes" upperBound="-1"
- eType="#//NodeC" eOpposite="#//NodeC/otherNodes"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="NodeD">
- <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
- eType="#//NodeD" containment="true" eOpposite="#//NodeD/parent"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//NodeD"
- eOpposite="#//NodeD/children"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="otherNodes" upperBound="-1"
- eType="#//NodeD" eOpposite="#//NodeD/oppositeNode"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="oppositeNode" eType="#//NodeD"
- eOpposite="#//NodeD/otherNodes"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="NodeE">
- <eStructuralFeatures xsi:type="ecore:EReference" name="mainNode" eType="#//NodeA"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="otherNodes" upperBound="-1"
- eType="#//NodeA"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Image">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="width" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="height" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="data" eType="ecore:EDataType ../../org.eclipse.emf.cdo/model/etypes.ecore#//Blob"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="File">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="data" eType="ecore:EDataType ../../org.eclipse.emf.cdo/model/etypes.ecore#//Clob"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ClassWithIDAttribute">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
- iD="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ClassWithJavaClassAttribute">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaClass" iD="true">
- <eGenericType eClassifier="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaClass">
- <eTypeArguments/>
- </eGenericType>
- </eStructuralFeatures>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ClassWithJavaObjectAttribute">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaObject" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"
- iD="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EdgeTarget">
- <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingEdges" upperBound="-1"
- eType="#//Edge" eOpposite="#//Edge/sourceNode"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="incomingEdges" upperBound="-1"
- eType="#//Edge" eOpposite="#//Edge/targetNode"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="NodeF" eSuperTypes="#//EdgeTarget"/>
- <eClassifiers xsi:type="ecore:EClass" name="Edge">
- <eStructuralFeatures xsi:type="ecore:EReference" name="sourceNode" lowerBound="1"
- eType="#//EdgeTarget" eOpposite="#//EdgeTarget/outgoingEdges"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="targetNode" lowerBound="1"
- eType="#//EdgeTarget" eOpposite="#//EdgeTarget/incomingEdges"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Diagram">
- <eStructuralFeatures xsi:type="ecore:EReference" name="edges" upperBound="-1"
- eType="#//Edge" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="edgeTargets" upperBound="-1"
- eType="#//EdgeTarget" containment="true"/>
- </eClassifiers>
- <eSubpackages name="subpackage" nsURI="http://www.eclipse.org/emf/CDO/tests/subpackage/1.0.0"
- nsPrefix="subpackage">
- <eClassifiers xsi:type="ecore:EClass" name="Class2">
- <eStructuralFeatures xsi:type="ecore:EReference" name="class1" upperBound="-1"
- eType="#//Class1" eOpposite="#//Class1/class2"/>
- </eClassifiers>
- </eSubpackages>
-</ecore:EPackage>
+<?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="model3" nsURI="http://www.eclipse.org/emf/CDO/tests/model3/1.0.0"
+ nsPrefix="model3">
+ <eClassifiers xsi:type="ecore:EClass" name="Class1">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="class2" upperBound="-1"
+ eType="#//subpackage/Class2" unsettable="true" eOpposite="#//subpackage/Class2/class1"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="MetaRef">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ePackageRef" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EPackage"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="eClassRef" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EClass"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="eReferenceRef" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EReference"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="Point" instanceClassName="org.eclipse.emf.cdo.tests.model3.Point">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@NoAuditing"/>
+ </eAnnotations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Polygon">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="points" lowerBound="1"
+ upperBound="-1" eType="#//Point"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="PolygonWithDuplicates">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="points" unique="false"
+ lowerBound="1" upperBound="-1" eType="#//Point"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NodeA">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
+ eType="#//NodeA" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="otherNodes" upperBound="-1"
+ eType="#//NodeA"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NodeB">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
+ eType="#//NodeB" containment="true" eOpposite="#//NodeB/parent"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//NodeB"
+ eOpposite="#//NodeB/children"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NodeC">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
+ eType="#//NodeC" containment="true" eOpposite="#//NodeC/parent"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//NodeC"
+ eOpposite="#//NodeC/children"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="otherNodes" upperBound="-1"
+ eType="#//NodeC" eOpposite="#//NodeC/oppositeNodes"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="oppositeNodes" upperBound="-1"
+ eType="#//NodeC" eOpposite="#//NodeC/otherNodes"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NodeD">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
+ eType="#//NodeD" containment="true" eOpposite="#//NodeD/parent"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//NodeD"
+ eOpposite="#//NodeD/children"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="otherNodes" upperBound="-1"
+ eType="#//NodeD" eOpposite="#//NodeD/oppositeNode"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="oppositeNode" eType="#//NodeD"
+ eOpposite="#//NodeD/otherNodes"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NodeE">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="mainNode" eType="#//NodeA"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="otherNodes" upperBound="-1"
+ eType="#//NodeA"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Image">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="width" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="height" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="data" eType="ecore:EDataType ../../org.eclipse.emf.cdo/model/etypes.ecore#//Blob"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="File">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="data" eType="ecore:EDataType ../../org.eclipse.emf.cdo/model/etypes.ecore#//Clob"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ClassWithIDAttribute">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
+ iD="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ClassWithJavaClassAttribute">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaClass" iD="true">
+ <eGenericType eClassifier="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaClass">
+ <eTypeArguments/>
+ </eGenericType>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ClassWithJavaObjectAttribute">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaObject" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"
+ iD="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ClassWithTransientContainment">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="transientChild" eType="#//ClassWithTransientContainment"
+ transient="true" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="transientChildren" upperBound="-1"
+ eType="#//ClassWithTransientContainment" transient="true" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="persistentChild" eType="#//ClassWithTransientContainment"
+ containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="persistentChildren" upperBound="-1"
+ eType="#//ClassWithTransientContainment" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="EdgeTarget">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingEdges" upperBound="-1"
+ eType="#//Edge" eOpposite="#//Edge/sourceNode"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="incomingEdges" upperBound="-1"
+ eType="#//Edge" eOpposite="#//Edge/targetNode"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="NodeF" eSuperTypes="#//EdgeTarget"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Edge">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="sourceNode" lowerBound="1"
+ eType="#//EdgeTarget" eOpposite="#//EdgeTarget/outgoingEdges"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="targetNode" lowerBound="1"
+ eType="#//EdgeTarget" eOpposite="#//EdgeTarget/incomingEdges"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Diagram">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="edges" upperBound="-1"
+ eType="#//Edge" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="edgeTargets" upperBound="-1"
+ eType="#//EdgeTarget" containment="true"/>
+ </eClassifiers>
+ <eSubpackages name="subpackage" nsURI="http://www.eclipse.org/emf/CDO/tests/subpackage/1.0.0"
+ nsPrefix="subpackage">
+ <eClassifiers xsi:type="ecore:EClass" name="Class2">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="class1" upperBound="-1"
+ eType="#//Class1" eOpposite="#//Class1/class2"/>
+ </eClassifiers>
+ </eSubpackages>
+</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel
index 0402774327..12a92afb53 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.genmodel
@@ -73,6 +73,13 @@
<genClasses ecoreClass="model3.ecore#//ClassWithJavaObjectAttribute">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//ClassWithJavaObjectAttribute/javaObject"/>
</genClasses>
+ <genClasses ecoreClass="model3.ecore#//ClassWithTransientContainment">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//ClassWithTransientContainment/name"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model3.ecore#//ClassWithTransientContainment/transientChild"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model3.ecore#//ClassWithTransientContainment/transientChildren"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model3.ecore#//ClassWithTransientContainment/persistentChild"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model3.ecore#//ClassWithTransientContainment/persistentChildren"/>
+ </genClasses>
<genClasses ecoreClass="model3.ecore#//EdgeTarget">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model3.ecore#//EdgeTarget/outgoingEdges"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model3.ecore#//EdgeTarget/incomingEdges"/>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.legacy.genmodel b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.legacy.genmodel
index 048f80bfd1..ae53d2d671 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.legacy.genmodel
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/model/model3.legacy.genmodel
@@ -72,6 +72,13 @@
<genClasses ecoreClass="model3.ecore#//ClassWithJavaObjectAttribute">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//ClassWithJavaObjectAttribute/javaObject"/>
</genClasses>
+ <genClasses ecoreClass="model3.ecore#//ClassWithTransientContainment">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute model3.ecore#//ClassWithTransientContainment/name"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model3.ecore#//ClassWithTransientContainment/transientChild"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model3.ecore#//ClassWithTransientContainment/transientChildren"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model3.ecore#//ClassWithTransientContainment/persistentChild"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference model3.ecore#//ClassWithTransientContainment/persistentChildren"/>
+ </genClasses>
<genClasses ecoreClass="model3.ecore#//EdgeTarget">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model3.ecore#//EdgeTarget/outgoingEdges"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model3.ecore#//EdgeTarget/incomingEdges"/>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/ClassWithTransientContainment.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/ClassWithTransientContainment.java
new file mode 100644
index 0000000000..2dd3cfd403
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/ClassWithTransientContainment.java
@@ -0,0 +1,140 @@
+/**
+ */
+package org.eclipse.emf.cdo.tests.model3;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Class With Transient Containment</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChild <em>Transient Child</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChildren <em>Transient Children</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChild <em>Persistent Child</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChildren <em>Persistent Children</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.emf.cdo.tests.model3.Model3Package#getClassWithTransientContainment()
+ * @model
+ * @generated
+ */
+public interface ClassWithTransientContainment extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.emf.cdo.tests.model3.Model3Package#getClassWithTransientContainment_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Transient Child</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Transient Child</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Transient Child</em>' containment reference.
+ * @see #setTransientChild(ClassWithTransientContainment)
+ * @see org.eclipse.emf.cdo.tests.model3.Model3Package#getClassWithTransientContainment_TransientChild()
+ * @model containment="true" transient="true"
+ * @generated
+ */
+ ClassWithTransientContainment getTransientChild();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChild <em>Transient Child</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Transient Child</em>' containment reference.
+ * @see #getTransientChild()
+ * @generated
+ */
+ void setTransientChild(ClassWithTransientContainment value);
+
+ /**
+ * Returns the value of the '<em><b>Transient Children</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Transient 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>Transient Children</em>' containment reference list.
+ * @see org.eclipse.emf.cdo.tests.model3.Model3Package#getClassWithTransientContainment_TransientChildren()
+ * @model containment="true" transient="true"
+ * @generated
+ */
+ EList<ClassWithTransientContainment> getTransientChildren();
+
+ /**
+ * Returns the value of the '<em><b>Persistent Child</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Persistent Child</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Persistent Child</em>' containment reference.
+ * @see #setPersistentChild(ClassWithTransientContainment)
+ * @see org.eclipse.emf.cdo.tests.model3.Model3Package#getClassWithTransientContainment_PersistentChild()
+ * @model containment="true"
+ * @generated
+ */
+ ClassWithTransientContainment getPersistentChild();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChild <em>Persistent Child</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Persistent Child</em>' containment reference.
+ * @see #getPersistentChild()
+ * @generated
+ */
+ void setPersistentChild(ClassWithTransientContainment value);
+
+ /**
+ * Returns the value of the '<em><b>Persistent Children</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Persistent 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>Persistent Children</em>' containment reference list.
+ * @see org.eclipse.emf.cdo.tests.model3.Model3Package#getClassWithTransientContainment_PersistentChildren()
+ * @model containment="true"
+ * @generated
+ */
+ EList<ClassWithTransientContainment> getPersistentChildren();
+
+} // ClassWithTransientContainment
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java
index 25e34515b0..3a7cbd6af5 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Factory.java
@@ -143,6 +143,15 @@ public interface Model3Factory extends EFactory
ClassWithJavaObjectAttribute createClassWithJavaObjectAttribute();
/**
+ * Returns a new object of class '<em>Class With Transient Containment</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Class With Transient Containment</em>'.
+ * @generated
+ */
+ ClassWithTransientContainment createClassWithTransientContainment();
+
+ /**
* Returns a new object of class '<em>Edge Target</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java
index c8c2d6479b..ea98a0e6d0 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/Model3Package.java
@@ -588,6 +588,70 @@ public interface Model3Package extends EPackage
int CLASS_WITH_JAVA_OBJECT_ATTRIBUTE_FEATURE_COUNT = 1;
/**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model3.impl.ClassWithTransientContainmentImpl <em>Class With Transient Containment</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.cdo.tests.model3.impl.ClassWithTransientContainmentImpl
+ * @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getClassWithTransientContainment()
+ * @generated
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT = 14;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Transient Child</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD = 1;
+
+ /**
+ * The feature id for the '<em><b>Transient Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN = 2;
+
+ /**
+ * The feature id for the '<em><b>Persistent Child</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD = 3;
+
+ /**
+ * The feature id for the '<em><b>Persistent Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN = 4;
+
+ /**
+ * The number of structural features of the '<em>Class With Transient Containment</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT_FEATURE_COUNT = 5;
+
+ /**
* The meta object id for the '{@link org.eclipse.emf.cdo.tests.model3.impl.EdgeTargetImpl <em>Edge Target</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -595,7 +659,7 @@ public interface Model3Package extends EPackage
* @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getEdgeTarget()
* @generated
*/
- int EDGE_TARGET = 14;
+ int EDGE_TARGET = 15;
/**
* The feature id for the '<em><b>Outgoing Edges</b></em>' reference list.
@@ -632,7 +696,7 @@ public interface Model3Package extends EPackage
* @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getNodeF()
* @generated
*/
- int NODE_F = 15;
+ int NODE_F = 16;
/**
* The feature id for the '<em><b>Outgoing Edges</b></em>' reference list.
@@ -669,7 +733,7 @@ public interface Model3Package extends EPackage
* @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getEdge()
* @generated
*/
- int EDGE = 16;
+ int EDGE = 17;
/**
* The feature id for the '<em><b>Source Node</b></em>' reference.
@@ -706,7 +770,7 @@ public interface Model3Package extends EPackage
* @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getDiagram()
* @generated
*/
- int DIAGRAM = 17;
+ int DIAGRAM = 18;
/**
* The feature id for the '<em><b>Edges</b></em>' containment reference list.
@@ -742,7 +806,7 @@ public interface Model3Package extends EPackage
* @see org.eclipse.emf.cdo.tests.model3.impl.Model3PackageImpl#getPoint()
* @generated
*/
- int POINT = 18;
+ int POINT = 19;
/**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model3.Class1 <em>Class1</em>}'. <!--
@@ -1223,6 +1287,71 @@ public interface Model3Package extends EPackage
EAttribute getClassWithJavaObjectAttribute_JavaObject();
/**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment <em>Class With Transient Containment</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Class With Transient Containment</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment
+ * @generated
+ */
+ EClass getClassWithTransientContainment();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getName()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EAttribute getClassWithTransientContainment_Name();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChild <em>Transient Child</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Transient Child</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChild()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EReference getClassWithTransientContainment_TransientChild();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChildren <em>Transient Children</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Transient Children</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChildren()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EReference getClassWithTransientContainment_TransientChildren();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChild <em>Persistent Child</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Persistent Child</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChild()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EReference getClassWithTransientContainment_PersistentChild();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChildren <em>Persistent Children</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Persistent Children</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChildren()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EReference getClassWithTransientContainment_PersistentChildren();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model3.EdgeTarget <em>Edge Target</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/ClassWithTransientContainmentImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/ClassWithTransientContainmentImpl.java
new file mode 100644
index 0000000000..f312a4ec7a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/ClassWithTransientContainmentImpl.java
@@ -0,0 +1,146 @@
+/**
+ */
+package org.eclipse.emf.cdo.tests.model3.impl;
+
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
+import org.eclipse.emf.cdo.tests.model3.Model3Package;
+
+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>Class With Transient Containment</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.impl.ClassWithTransientContainmentImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.impl.ClassWithTransientContainmentImpl#getTransientChild <em>Transient Child</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.impl.ClassWithTransientContainmentImpl#getTransientChildren <em>Transient Children</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.impl.ClassWithTransientContainmentImpl#getPersistentChild <em>Persistent Child</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.impl.ClassWithTransientContainmentImpl#getPersistentChildren <em>Persistent Children</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class ClassWithTransientContainmentImpl extends CDOObjectImpl implements ClassWithTransientContainment
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ClassWithTransientContainmentImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return Model3Package.eINSTANCE.getClassWithTransientContainment();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return (String)eGet(Model3Package.eINSTANCE.getClassWithTransientContainment_Name(), true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ eSet(Model3Package.eINSTANCE.getClassWithTransientContainment_Name(), newName);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ClassWithTransientContainment getTransientChild()
+ {
+ return (ClassWithTransientContainment)eGet(Model3Package.eINSTANCE.getClassWithTransientContainment_TransientChild(), true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTransientChild(ClassWithTransientContainment newTransientChild)
+ {
+ eSet(Model3Package.eINSTANCE.getClassWithTransientContainment_TransientChild(), newTransientChild);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EList<ClassWithTransientContainment> getTransientChildren()
+ {
+ return (EList<ClassWithTransientContainment>)eGet(Model3Package.eINSTANCE.getClassWithTransientContainment_TransientChildren(), true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ClassWithTransientContainment getPersistentChild()
+ {
+ return (ClassWithTransientContainment)eGet(Model3Package.eINSTANCE.getClassWithTransientContainment_PersistentChild(), true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPersistentChild(ClassWithTransientContainment newPersistentChild)
+ {
+ eSet(Model3Package.eINSTANCE.getClassWithTransientContainment_PersistentChild(), newPersistentChild);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EList<ClassWithTransientContainment> getPersistentChildren()
+ {
+ return (EList<ClassWithTransientContainment>)eGet(Model3Package.eINSTANCE.getClassWithTransientContainment_PersistentChildren(), true);
+ }
+
+} // ClassWithTransientContainmentImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java
index fc8c0da013..c0ec92ac52 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3FactoryImpl.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -115,6 +116,8 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
return createClassWithJavaClassAttribute();
case Model3Package.CLASS_WITH_JAVA_OBJECT_ATTRIBUTE:
return createClassWithJavaObjectAttribute();
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT:
+ return createClassWithTransientContainment();
case Model3Package.EDGE_TARGET:
return createEdgeTarget();
case Model3Package.NODE_F:
@@ -308,6 +311,17 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
* <!-- end-user-doc -->
* @generated
*/
+ public ClassWithTransientContainment createClassWithTransientContainment()
+ {
+ ClassWithTransientContainmentImpl classWithTransientContainment = new ClassWithTransientContainmentImpl();
+ return classWithTransientContainment;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EdgeTarget createEdgeTarget()
{
EdgeTargetImpl edgeTarget = new EdgeTargetImpl();
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java
index 7b87bac21c..a2f6aaa205 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/impl/Model3PackageImpl.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -142,6 +143,13 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
* <!-- end-user-doc -->
* @generated
*/
+ private EClass classWithTransientContainmentEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass edgeTargetEClass = null;
/**
@@ -682,6 +690,66 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getClassWithTransientContainment()
+ {
+ return classWithTransientContainmentEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getClassWithTransientContainment_Name()
+ {
+ return (EAttribute)classWithTransientContainmentEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassWithTransientContainment_TransientChild()
+ {
+ return (EReference)classWithTransientContainmentEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassWithTransientContainment_TransientChildren()
+ {
+ return (EReference)classWithTransientContainmentEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassWithTransientContainment_PersistentChild()
+ {
+ return (EReference)classWithTransientContainmentEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassWithTransientContainment_PersistentChildren()
+ {
+ return (EReference)classWithTransientContainmentEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getEdgeTarget()
{
return edgeTargetEClass;
@@ -877,6 +945,13 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
classWithJavaObjectAttributeEClass = createEClass(CLASS_WITH_JAVA_OBJECT_ATTRIBUTE);
createEAttribute(classWithJavaObjectAttributeEClass, CLASS_WITH_JAVA_OBJECT_ATTRIBUTE__JAVA_OBJECT);
+ classWithTransientContainmentEClass = createEClass(CLASS_WITH_TRANSIENT_CONTAINMENT);
+ createEAttribute(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__NAME);
+ createEReference(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD);
+ createEReference(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN);
+ createEReference(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD);
+ createEReference(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN);
+
edgeTargetEClass = createEClass(EDGE_TARGET);
createEReference(edgeTargetEClass, EDGE_TARGET__OUTGOING_EDGES);
createEReference(edgeTargetEClass, EDGE_TARGET__INCOMING_EDGES);
@@ -1035,6 +1110,23 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
initEAttribute(getClassWithJavaObjectAttribute_JavaObject(), theEcorePackage.getEJavaObject(), "javaObject", null, 0, 1, ClassWithJavaObjectAttribute.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(classWithTransientContainmentEClass, ClassWithTransientContainment.class, "ClassWithTransientContainment", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getClassWithTransientContainment_Name(), theEcorePackage.getEString(), "name", null, 0, 1, ClassWithTransientContainment.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassWithTransientContainment_TransientChild(), getClassWithTransientContainment(), null, "transientChild", null, 0, 1,
+ ClassWithTransientContainment.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassWithTransientContainment_TransientChildren(), getClassWithTransientContainment(), null, "transientChildren", null, 0, -1,
+ ClassWithTransientContainment.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassWithTransientContainment_PersistentChild(), getClassWithTransientContainment(), null, "persistentChild", null, 0, 1,
+ ClassWithTransientContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassWithTransientContainment_PersistentChildren(), getClassWithTransientContainment(), null, "persistentChildren", null, 0, -1,
+ ClassWithTransientContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+
initEClass(edgeTargetEClass, EdgeTarget.class, "EdgeTarget", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getEdgeTarget_OutgoingEdges(), getEdge(), getEdge_SourceNode(), "outgoingEdges", null, 0, -1, EdgeTarget.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Factory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Factory.java
index 0a46313aa0..4d65d7329d 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Factory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Factory.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -164,6 +165,15 @@ public interface Model3Factory extends EFactory, org.eclipse.emf.cdo.tests.model
ClassWithJavaObjectAttribute createClassWithJavaObjectAttribute();
/**
+ * Returns a new object of class '<em>Class With Transient Containment</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Class With Transient Containment</em>'.
+ * @generated
+ */
+ ClassWithTransientContainment createClassWithTransientContainment();
+
+ /**
* Returns a new object of class '<em>Edge Target</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Package.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Package.java
index 491aac52c5..091ab63659 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/Model3Package.java
@@ -581,6 +581,70 @@ public interface Model3Package extends EPackage, org.eclipse.emf.cdo.tests.model
int CLASS_WITH_JAVA_OBJECT_ATTRIBUTE_FEATURE_COUNT = 1;
/**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model3.legacy.impl.ClassWithTransientContainmentImpl <em>Class With Transient Containment</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.cdo.tests.model3.legacy.impl.ClassWithTransientContainmentImpl
+ * @see org.eclipse.emf.cdo.tests.model3.legacy.impl.Model3PackageImpl#getClassWithTransientContainment()
+ * @generated
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT = 14;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Transient Child</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD = 1;
+
+ /**
+ * The feature id for the '<em><b>Transient Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN = 2;
+
+ /**
+ * The feature id for the '<em><b>Persistent Child</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD = 3;
+
+ /**
+ * The feature id for the '<em><b>Persistent Children</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN = 4;
+
+ /**
+ * The number of structural features of the '<em>Class With Transient Containment</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_WITH_TRANSIENT_CONTAINMENT_FEATURE_COUNT = 5;
+
+ /**
* The meta object id for the '{@link org.eclipse.emf.cdo.tests.model3.legacy.impl.EdgeTargetImpl <em>Edge Target</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -588,7 +652,7 @@ public interface Model3Package extends EPackage, org.eclipse.emf.cdo.tests.model
* @see org.eclipse.emf.cdo.tests.model3.legacy.impl.Model3PackageImpl#getEdgeTarget()
* @generated
*/
- int EDGE_TARGET = 14;
+ int EDGE_TARGET = 15;
/**
* The feature id for the '<em><b>Outgoing Edges</b></em>' reference list.
@@ -625,7 +689,7 @@ public interface Model3Package extends EPackage, org.eclipse.emf.cdo.tests.model
* @see org.eclipse.emf.cdo.tests.model3.legacy.impl.Model3PackageImpl#getNodeF()
* @generated
*/
- int NODE_F = 15;
+ int NODE_F = 16;
/**
* The feature id for the '<em><b>Outgoing Edges</b></em>' reference list.
@@ -662,7 +726,7 @@ public interface Model3Package extends EPackage, org.eclipse.emf.cdo.tests.model
* @see org.eclipse.emf.cdo.tests.model3.legacy.impl.Model3PackageImpl#getEdge()
* @generated
*/
- int EDGE = 16;
+ int EDGE = 17;
/**
* The feature id for the '<em><b>Source Node</b></em>' reference.
@@ -699,7 +763,7 @@ public interface Model3Package extends EPackage, org.eclipse.emf.cdo.tests.model
* @see org.eclipse.emf.cdo.tests.model3.legacy.impl.Model3PackageImpl#getDiagram()
* @generated
*/
- int DIAGRAM = 17;
+ int DIAGRAM = 18;
/**
* The feature id for the '<em><b>Edges</b></em>' containment reference list.
@@ -735,7 +799,7 @@ public interface Model3Package extends EPackage, org.eclipse.emf.cdo.tests.model
* @see org.eclipse.emf.cdo.tests.model3.legacy.impl.Model3PackageImpl#getPoint()
* @generated
*/
- int POINT = 18;
+ int POINT = 19;
/**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.legacy.model3.Class1 <em>Class1</em>}'. <!--
@@ -1223,6 +1287,71 @@ public interface Model3Package extends EPackage, org.eclipse.emf.cdo.tests.model
EAttribute getClassWithJavaObjectAttribute_JavaObject();
/**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment <em>Class With Transient Containment</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Class With Transient Containment</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment
+ * @generated
+ */
+ EClass getClassWithTransientContainment();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getName()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EAttribute getClassWithTransientContainment_Name();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChild <em>Transient Child</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Transient Child</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChild()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EReference getClassWithTransientContainment_TransientChild();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChildren <em>Transient Children</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Transient Children</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getTransientChildren()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EReference getClassWithTransientContainment_TransientChildren();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChild <em>Persistent Child</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Persistent Child</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChild()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EReference getClassWithTransientContainment_PersistentChild();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChildren <em>Persistent Children</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Persistent Children</em>'.
+ * @see org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment#getPersistentChildren()
+ * @see #getClassWithTransientContainment()
+ * @generated
+ */
+ EReference getClassWithTransientContainment_PersistentChildren();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model3.EdgeTarget <em>Edge Target</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/ClassWithTransientContainmentImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/ClassWithTransientContainmentImpl.java
new file mode 100644
index 0000000000..abf3a8b443
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/ClassWithTransientContainmentImpl.java
@@ -0,0 +1,462 @@
+/**
+ */
+package org.eclipse.emf.cdo.tests.model3.legacy.impl;
+
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
+import org.eclipse.emf.cdo.tests.model3.legacy.Model3Package;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import java.util.Collection;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Class With Transient Containment</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.legacy.impl.ClassWithTransientContainmentImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.legacy.impl.ClassWithTransientContainmentImpl#getTransientChild <em>Transient Child</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.legacy.impl.ClassWithTransientContainmentImpl#getTransientChildren <em>Transient Children</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.legacy.impl.ClassWithTransientContainmentImpl#getPersistentChild <em>Persistent Child</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model3.legacy.impl.ClassWithTransientContainmentImpl#getPersistentChildren <em>Persistent Children</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class ClassWithTransientContainmentImpl extends EObjectImpl implements ClassWithTransientContainment
+{
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getTransientChild() <em>Transient Child</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTransientChild()
+ * @generated
+ * @ordered
+ */
+ protected ClassWithTransientContainment transientChild;
+
+ /**
+ * The cached value of the '{@link #getTransientChildren() <em>Transient Children</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTransientChildren()
+ * @generated
+ * @ordered
+ */
+ protected EList<ClassWithTransientContainment> transientChildren;
+
+ /**
+ * The cached value of the '{@link #getPersistentChild() <em>Persistent Child</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPersistentChild()
+ * @generated
+ * @ordered
+ */
+ protected ClassWithTransientContainment persistentChild;
+
+ /**
+ * The cached value of the '{@link #getPersistentChildren() <em>Persistent Children</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPersistentChildren()
+ * @generated
+ * @ordered
+ */
+ protected EList<ClassWithTransientContainment> persistentChildren;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ClassWithTransientContainmentImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return Model3Package.eINSTANCE.getClassWithTransientContainment();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__NAME, oldName, name));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ClassWithTransientContainment getTransientChild()
+ {
+ return transientChild;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetTransientChild(ClassWithTransientContainment newTransientChild, NotificationChain msgs)
+ {
+ ClassWithTransientContainment oldTransientChild = transientChild;
+ transientChild = newTransientChild;
+ if (eNotificationRequired())
+ {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD,
+ oldTransientChild, newTransientChild);
+ if (msgs == null)
+ {
+ msgs = notification;
+ }
+ else
+ {
+ msgs.add(notification);
+ }
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTransientChild(ClassWithTransientContainment newTransientChild)
+ {
+ if (newTransientChild != transientChild)
+ {
+ NotificationChain msgs = null;
+ if (transientChild != null)
+ {
+ msgs = ((InternalEObject)transientChild).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD,
+ null, msgs);
+ }
+ if (newTransientChild != null)
+ {
+ msgs = ((InternalEObject)newTransientChild).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD,
+ null, msgs);
+ }
+ msgs = basicSetTransientChild(newTransientChild, msgs);
+ if (msgs != null)
+ {
+ msgs.dispatch();
+ }
+ }
+ else if (eNotificationRequired())
+ {
+ eNotify(
+ new ENotificationImpl(this, Notification.SET, Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD, newTransientChild, newTransientChild));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<ClassWithTransientContainment> getTransientChildren()
+ {
+ if (transientChildren == null)
+ {
+ transientChildren = new EObjectContainmentEList<ClassWithTransientContainment>(ClassWithTransientContainment.class, this,
+ Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN);
+ }
+ return transientChildren;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ClassWithTransientContainment getPersistentChild()
+ {
+ return persistentChild;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetPersistentChild(ClassWithTransientContainment newPersistentChild, NotificationChain msgs)
+ {
+ ClassWithTransientContainment oldPersistentChild = persistentChild;
+ persistentChild = newPersistentChild;
+ if (eNotificationRequired())
+ {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD,
+ oldPersistentChild, newPersistentChild);
+ if (msgs == null)
+ {
+ msgs = notification;
+ }
+ else
+ {
+ msgs.add(notification);
+ }
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPersistentChild(ClassWithTransientContainment newPersistentChild)
+ {
+ if (newPersistentChild != persistentChild)
+ {
+ NotificationChain msgs = null;
+ if (persistentChild != null)
+ {
+ msgs = ((InternalEObject)persistentChild).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD, null, msgs);
+ }
+ if (newPersistentChild != null)
+ {
+ msgs = ((InternalEObject)newPersistentChild).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD, null, msgs);
+ }
+ msgs = basicSetPersistentChild(newPersistentChild, msgs);
+ if (msgs != null)
+ {
+ msgs.dispatch();
+ }
+ }
+ else if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD, newPersistentChild,
+ newPersistentChild));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<ClassWithTransientContainment> getPersistentChildren()
+ {
+ if (persistentChildren == null)
+ {
+ persistentChildren = new EObjectContainmentEList<ClassWithTransientContainment>(ClassWithTransientContainment.class, this,
+ Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN);
+ }
+ return persistentChildren;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD:
+ return basicSetTransientChild(null, msgs);
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN:
+ return ((InternalEList<?>)getTransientChildren()).basicRemove(otherEnd, msgs);
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD:
+ return basicSetPersistentChild(null, msgs);
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN:
+ return ((InternalEList<?>)getPersistentChildren()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__NAME:
+ return getName();
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD:
+ return getTransientChild();
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN:
+ return getTransientChildren();
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD:
+ return getPersistentChild();
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN:
+ return getPersistentChildren();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__NAME:
+ setName((String)newValue);
+ return;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD:
+ setTransientChild((ClassWithTransientContainment)newValue);
+ return;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN:
+ getTransientChildren().clear();
+ getTransientChildren().addAll((Collection<? extends ClassWithTransientContainment>)newValue);
+ return;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD:
+ setPersistentChild((ClassWithTransientContainment)newValue);
+ return;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN:
+ getPersistentChildren().clear();
+ getPersistentChildren().addAll((Collection<? extends ClassWithTransientContainment>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD:
+ setTransientChild((ClassWithTransientContainment)null);
+ return;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN:
+ getTransientChildren().clear();
+ return;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD:
+ setPersistentChild((ClassWithTransientContainment)null);
+ return;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN:
+ getPersistentChildren().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD:
+ return transientChild != null;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN:
+ return transientChildren != null && !transientChildren.isEmpty();
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD:
+ return persistentChild != null;
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN:
+ return persistentChildren != null && !persistentChildren.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy())
+ {
+ return super.toString();
+ }
+
+ StringBuilder result = new StringBuilder(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ClassWithTransientContainmentImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3FactoryImpl.java
index adc1c7dd5b..27a013a6cd 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3FactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3FactoryImpl.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -115,6 +116,8 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
return createClassWithJavaClassAttribute();
case Model3Package.CLASS_WITH_JAVA_OBJECT_ATTRIBUTE:
return createClassWithJavaObjectAttribute();
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT:
+ return createClassWithTransientContainment();
case Model3Package.EDGE_TARGET:
return createEdgeTarget();
case Model3Package.NODE_F:
@@ -308,6 +311,17 @@ public class Model3FactoryImpl extends EFactoryImpl implements Model3Factory
* <!-- end-user-doc -->
* @generated
*/
+ public ClassWithTransientContainment createClassWithTransientContainment()
+ {
+ ClassWithTransientContainmentImpl classWithTransientContainment = new ClassWithTransientContainmentImpl();
+ return classWithTransientContainment;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EdgeTarget createEdgeTarget()
{
EdgeTargetImpl edgeTarget = new EdgeTargetImpl();
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3PackageImpl.java
index d36f655abc..1504500101 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/Model3PackageImpl.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -142,6 +143,13 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
* <!-- end-user-doc -->
* @generated
*/
+ private EClass classWithTransientContainmentEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass edgeTargetEClass = null;
/**
@@ -682,6 +690,66 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getClassWithTransientContainment()
+ {
+ return classWithTransientContainmentEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getClassWithTransientContainment_Name()
+ {
+ return (EAttribute)classWithTransientContainmentEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassWithTransientContainment_TransientChild()
+ {
+ return (EReference)classWithTransientContainmentEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassWithTransientContainment_TransientChildren()
+ {
+ return (EReference)classWithTransientContainmentEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassWithTransientContainment_PersistentChild()
+ {
+ return (EReference)classWithTransientContainmentEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getClassWithTransientContainment_PersistentChildren()
+ {
+ return (EReference)classWithTransientContainmentEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getEdgeTarget()
{
return edgeTargetEClass;
@@ -877,6 +945,13 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
classWithJavaObjectAttributeEClass = createEClass(CLASS_WITH_JAVA_OBJECT_ATTRIBUTE);
createEAttribute(classWithJavaObjectAttributeEClass, CLASS_WITH_JAVA_OBJECT_ATTRIBUTE__JAVA_OBJECT);
+ classWithTransientContainmentEClass = createEClass(CLASS_WITH_TRANSIENT_CONTAINMENT);
+ createEAttribute(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__NAME);
+ createEReference(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILD);
+ createEReference(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__TRANSIENT_CHILDREN);
+ createEReference(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILD);
+ createEReference(classWithTransientContainmentEClass, CLASS_WITH_TRANSIENT_CONTAINMENT__PERSISTENT_CHILDREN);
+
edgeTargetEClass = createEClass(EDGE_TARGET);
createEReference(edgeTargetEClass, EDGE_TARGET__OUTGOING_EDGES);
createEReference(edgeTargetEClass, EDGE_TARGET__INCOMING_EDGES);
@@ -1035,6 +1110,23 @@ public class Model3PackageImpl extends EPackageImpl implements Model3Package
initEAttribute(getClassWithJavaObjectAttribute_JavaObject(), theEcorePackage.getEJavaObject(), "javaObject", null, 0, 1, ClassWithJavaObjectAttribute.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(classWithTransientContainmentEClass, ClassWithTransientContainment.class, "ClassWithTransientContainment", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getClassWithTransientContainment_Name(), theEcorePackage.getEString(), "name", null, 0, 1, ClassWithTransientContainment.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassWithTransientContainment_TransientChild(), getClassWithTransientContainment(), null, "transientChild", null, 0, 1,
+ ClassWithTransientContainment.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassWithTransientContainment_TransientChildren(), getClassWithTransientContainment(), null, "transientChildren", null, 0, -1,
+ ClassWithTransientContainment.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassWithTransientContainment_PersistentChild(), getClassWithTransientContainment(), null, "persistentChild", null, 0, 1,
+ ClassWithTransientContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getClassWithTransientContainment_PersistentChildren(), getClassWithTransientContainment(), null, "persistentChildren", null, 0, -1,
+ ClassWithTransientContainment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+
initEClass(edgeTargetEClass, EdgeTarget.class, "EdgeTarget", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getEdgeTarget_OutgoingEdges(), getEdge(), getEdge_SourceNode(), "outgoingEdges", null, 0, -1, EdgeTarget.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3AdapterFactory.java
index ef952a99d5..55b1c3411c 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3AdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3AdapterFactory.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -183,6 +184,12 @@ public class Model3AdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseClassWithTransientContainment(ClassWithTransientContainment object)
+ {
+ return createClassWithTransientContainmentAdapter();
+ }
+
+ @Override
public Adapter caseEdgeTarget(EdgeTarget object)
{
return createEdgeTargetAdapter();
@@ -438,6 +445,21 @@ public class Model3AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment <em>Class With Transient 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.model3.ClassWithTransientContainment
+ * @generated
+ */
+ public Adapter createClassWithTransientContainmentAdapter()
+ {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model3.EdgeTarget <em>Edge Target</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3Switch.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3Switch.java
index 6cb9cd32ad..2dd04e1fab 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3Switch.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/util/Model3Switch.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -257,6 +258,16 @@ public class Model3Switch<T>
}
return result;
}
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT:
+ {
+ ClassWithTransientContainment classWithTransientContainment = (ClassWithTransientContainment)theEObject;
+ T result = caseClassWithTransientContainment(classWithTransientContainment);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
case Model3Package.EDGE_TARGET:
{
EdgeTarget edgeTarget = (EdgeTarget)theEObject;
@@ -531,6 +542,22 @@ public class Model3Switch<T>
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Class With Transient 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>Class With Transient Containment</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseClassWithTransientContainment(ClassWithTransientContainment object)
+ {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Edge Target</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java
index e5eda3b3ef..0def2e5685 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3AdapterFactory.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -178,6 +179,12 @@ public class Model3AdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseClassWithTransientContainment(ClassWithTransientContainment object)
+ {
+ return createClassWithTransientContainmentAdapter();
+ }
+
+ @Override
public Adapter caseEdgeTarget(EdgeTarget object)
{
return createEdgeTargetAdapter();
@@ -418,6 +425,21 @@ public class Model3AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment <em>Class With Transient 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.model3.ClassWithTransientContainment
+ * @generated
+ */
+ public Adapter createClassWithTransientContainmentAdapter()
+ {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model3.EdgeTarget <em>Edge Target</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java
index 895c9c83b2..77c902e567 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/util/Model3Switch.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.tests.model3.Class1;
import org.eclipse.emf.cdo.tests.model3.ClassWithIDAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaClassAttribute;
import org.eclipse.emf.cdo.tests.model3.ClassWithJavaObjectAttribute;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
import org.eclipse.emf.cdo.tests.model3.Diagram;
import org.eclipse.emf.cdo.tests.model3.Edge;
import org.eclipse.emf.cdo.tests.model3.EdgeTarget;
@@ -247,6 +248,16 @@ public class Model3Switch<T>
}
return result;
}
+ case Model3Package.CLASS_WITH_TRANSIENT_CONTAINMENT:
+ {
+ ClassWithTransientContainment classWithTransientContainment = (ClassWithTransientContainment)theEObject;
+ T result = caseClassWithTransientContainment(classWithTransientContainment);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
case Model3Package.EDGE_TARGET:
{
EdgeTarget edgeTarget = (EdgeTarget)theEObject;
@@ -503,6 +514,22 @@ public class Model3Switch<T>
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Class With Transient 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>Class With Transient Containment</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseClassWithTransientContainment(ClassWithTransientContainment object)
+ {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Edge Target</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
index ebab329708..9bed83030a 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
@@ -330,7 +330,6 @@ public class CrossReferenceTest extends AbstractCDOTest
@Requires(IRepositoryConfig.CAPABILITY_EXTERNAL_REFS)
public void testDetachXRefExternal() throws Exception
{
-
Customer customer = getModel1Factory().createCustomer();
customer.setName("customer");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_528129_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_528129_Test.java
new file mode 100644
index 0000000000..53338aa508
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_528129_Test.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2018 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.bugzilla;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.CDOState;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.config.IModelConfig;
+import org.eclipse.emf.cdo.tests.model3.ClassWithTransientContainment;
+import org.eclipse.emf.cdo.tests.model3.Model3Factory;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.util.CDOUtil;
+import org.eclipse.emf.cdo.view.CDOObjectHandler;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Bug 528129: Transient objects are attached to CDOTransaction.
+ *
+ * @author Eike Stepper
+ */
+public class Bugzilla_528129_Test extends AbstractCDOTest
+{
+ @Skips(IModelConfig.CAPABILITY_LEGACY)
+ public void testTransientContainment() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("res"));
+
+ ClassWithTransientContainment root = createObject("root");
+ new StateChangeDetector(transaction, root);
+ resource.getContents().add(root);
+ assertNew(root, transaction);
+
+ ClassWithTransientContainment child = createObject("child");
+ root.getTransientChildren().add(child);
+ assertTransient(child);
+ }
+
+ public void testTransientContainmentTree() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("res"));
+
+ ClassWithTransientContainment root = createObject("root");
+ resource.getContents().add(root);
+ assertNew(root, transaction);
+
+ ClassWithTransientContainment child = createObject("child");
+ child.getTransientChildren().add(createObject("subchild1"));
+ child.getTransientChildren().add(createObject("subchild2"));
+ child.getTransientChildren().add(createObject("subchild3"));
+ root.getTransientChildren().add(child);
+
+ for (ClassWithTransientContainment c : child.getTransientChildren())
+ {
+ assertTransient(c);
+ }
+ }
+
+ public void testPersistentContainment() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("res"));
+
+ ClassWithTransientContainment root = Model3Factory.eINSTANCE.createClassWithTransientContainment();
+ resource.getContents().add(root);
+ assertNew(root, transaction);
+
+ ClassWithTransientContainment child = createObject("child");
+ root.getPersistentChildren().add(child);
+ assertNew(child, transaction);
+ }
+
+ public void testPersistentContainmentTree() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("res"));
+
+ ClassWithTransientContainment root = createObject("root");
+ resource.getContents().add(root);
+ assertNew(root, transaction);
+
+ ClassWithTransientContainment child = createObject("child");
+ child.getPersistentChildren().add(createObject("subchild1"));
+ child.getPersistentChildren().add(createObject("subchild2"));
+ child.getPersistentChildren().add(createObject("subchild3"));
+ root.getPersistentChildren().add(child);
+
+ for (ClassWithTransientContainment c : child.getTransientChildren())
+ {
+ assertNew(c, transaction);
+ }
+ }
+
+ @Skips(IModelConfig.CAPABILITY_LEGACY)
+ public void testMoveToTransientContainment() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("res"));
+
+ ClassWithTransientContainment root = createObject("root");
+ resource.getContents().add(root);
+ assertNew(root, transaction);
+
+ ClassWithTransientContainment child = createObject("child");
+ root.getPersistentChildren().add(child);
+ assertNew(child, transaction);
+
+ root.getTransientChildren().add(child);
+ assertTransient(child);
+ }
+
+ @Skips(IModelConfig.CAPABILITY_LEGACY)
+ public void testMoveToPersistentContainment() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("res"));
+
+ ClassWithTransientContainment root = createObject("root");
+ resource.getContents().add(root);
+ assertNew(root, transaction);
+
+ ClassWithTransientContainment child = createObject("child");
+ root.getTransientChildren().add(child);
+ assertTransient(child);
+
+ root.getPersistentChildren().add(child);
+ assertNew(child, transaction);
+ }
+
+ public void testMoveWithinView() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("res"));
+
+ ClassWithTransientContainment root1 = createObject("root1");
+ resource.getContents().add(root1);
+ assertNew(root1, transaction);
+
+ ClassWithTransientContainment root2 = createObject("root2");
+ resource.getContents().add(root2);
+ assertNew(root2, transaction);
+
+ ClassWithTransientContainment child = createObject("child");
+ root1.getPersistentChildren().add(child);
+ assertNew(child, transaction);
+
+ StateChangeDetector detector = new StateChangeDetector(transaction, child);
+ root2.getPersistentChildren().add(child);
+ assertNew(child, transaction);
+ assertFalse(detector.isStateChanged());
+ }
+
+ private ClassWithTransientContainment createObject(String name)
+ {
+ ClassWithTransientContainment object = getModel3Factory().createClassWithTransientContainment();
+ object.setName(name);
+ return object;
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class StateChangeDetector implements CDOObjectHandler
+ {
+ private final CDOObject object;
+
+ private boolean stateChanged;
+
+ public StateChangeDetector(CDOView view, EObject object)
+ {
+ this.object = CDOUtil.getCDOObject(object);
+ view.addObjectHandler(this);
+ }
+
+ public boolean isStateChanged()
+ {
+ return stateChanged;
+ }
+
+ public void objectStateChanged(CDOView view, CDOObject object, CDOState oldState, CDOState newState)
+ {
+ if (object == this.object)
+ {
+ stateChanged = true;
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
index 31854b1d44..bc269e6312 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
@@ -52,8 +52,6 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EStoreEObjectImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.EcoreUtil.ContentTreeIterator;
@@ -111,21 +109,13 @@ import java.util.concurrent.atomic.AtomicInteger;
* <li>{@link org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl#getTimeStamp <em>Time Stamp</em>}</li>
* </ul>
*
- * @generated
+ * @generated not
*/
-@SuppressWarnings("unused")
-public class CDOResourceImpl extends CDOResourceLeafImpl implements CDOResource, InternalCDOResource
+public class CDOResourceImpl extends CDOResourceLeafImpl implements InternalCDOResource
{
private static final EReference CDO_RESOURCE_CONTENTS = EresourcePackage.eINSTANCE.getCDOResource_Contents();
/**
- * The default URI converter when there is no resource set.
- *
- * @ADDED
- */
- private static URIConverter defaultURIConverter;
-
- /**
* @ADDED
*/
private boolean root;
@@ -1296,36 +1286,6 @@ public class CDOResourceImpl extends CDOResourceLeafImpl implements CDOResource,
}
/**
- * Returns the URI converter. This typically gets the {@link ResourceSet#getURIConverter converter} from the
- * {@link #getResourceSet containing} resource set, but it calls {@link #getDefaultURIConverter} when there is no
- * containing resource set.
- *
- * @return the URI converter.
- * @ADDED
- */
- private URIConverter getURIConverter()
- {
- return getResourceSet() == null ? getDefaultURIConverter() : getResourceSet().getURIConverter();
- }
-
- /**
- * Returns the default URI converter that's used when there is no resource set.
- *
- * @return the default URI converter.
- * @see #getURIConverter
- * @ADDED
- */
- private static synchronized URIConverter getDefaultURIConverter()
- {
- if (defaultURIConverter == null)
- {
- defaultURIConverter = new ExtensibleURIConverterImpl();
- }
-
- return defaultURIConverter;
- }
-
- /**
* @ADDED
*/
public void save(Map<?, ?> options) throws IOException
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index cf53f83509..6e8658f3b6 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -768,19 +768,26 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
@Override
public final NotificationChain eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID, NotificationChain msgs)
{
- boolean isResource = this instanceof CDOResource;
- boolean isRootResource = isResource && ((CDOResource)this).isRoot();
-
InternalEObject oldContainer = eInternalContainer();
Resource.Internal oldResource = eDirectResource();
Resource.Internal newResource = null;
+ EReference newContainmentFeature = null;
+
if (oldResource != null)
{
- if (newContainer != null && !eContainmentFeature(this, newContainer, newContainerFeatureID).isResolveProxies())
+ if (newContainer != null)
{
- msgs = ((InternalEList<?>)oldResource.getContents()).basicRemove(this, msgs);
- eSetDirectResource(null);
- newResource = newContainer.eInternalResource();
+ newContainmentFeature = eContainmentFeature(this, newContainer, newContainerFeatureID);
+ if (!newContainmentFeature.isResolveProxies())
+ {
+ msgs = ((InternalEList<?>)oldResource.getContents()).basicRemove(this, msgs);
+ eSetDirectResource(null);
+ newResource = newContainer.eInternalResource();
+ }
+ else
+ {
+ oldResource = null;
+ }
}
else
{
@@ -801,20 +808,62 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
CDOView oldView = viewAndState.view;
- CDOView newView = newResource != null && newResource instanceof CDOResource ? ((CDOResource)newResource).cdoView() : null;
+ CDOView newView = newResource instanceof CDOResource ? ((CDOResource)newResource).cdoView() : null;
+ boolean movedWithinView = oldView != null && oldView == newView;
+
+ boolean oldAttached = viewAndState.state != CDOState.TRANSIENT;
+ boolean newAttached = newContainer != null && newView != null ? FSMUtil.adapt(newContainer, newView).cdoState() != CDOState.TRANSIENT : true;
+
+ if (newAttached)
+ {
+ if (newContainmentFeature == null && newContainer != null)
+ {
+ newContainmentFeature = eContainmentFeature(this, newContainer, newContainerFeatureID);
+ }
+
+ if (newContainmentFeature != null && newContainmentFeature.isTransient())
+ {
+ newAttached = false;
+ }
+ }
+
+ if (newAttached != oldAttached)
+ {
+ movedWithinView = false;
+ }
- boolean moved = oldView != null && oldView == newView;
- if (!moved && oldResource != null && oldResource != newResource && !isRootResource)
+ if (oldResource != null)
{
- oldResource.detached(this);
+ if (oldResource instanceof CDOResource)
+ {
+ if (oldAttached && !movedWithinView && !isRootResource())
+ {
+ oldResource.detached(this);
+ }
+ }
+ else if (oldResource != newResource)
+ {
+ // Non-CDO resources may always expect the detached() call.
+ oldResource.detached(this);
+ }
}
int oldContainerFeatureID = eContainerFeatureID();
eBasicSetContainer(newContainer, newContainerFeatureID);
- if (!moved && newResource != null && newResource != oldResource)
+ if (newResource != null)
{
- newResource.attached(this);
+ if (newResource instanceof CDOResource)
+ {
+ if (newAttached && !movedWithinView)
+ {
+ newResource.attached(this);
+ }
+ }
+ else if (oldResource != newResource)
+ {
+ newResource.attached(this);
+ }
}
if (newContainer != null && newContainer != oldContainer && this instanceof CDOResourceNodeImpl)
@@ -856,7 +905,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
/**
- * Code took from {@link BasicEObjectImpl#eSetResource} and modify it to detect when object are moved in the same
+ * Code taken from {@link BasicEObjectImpl#eSetResource} and modified to detect when objects are moved in the same
* context.
*
* @since 2.0
@@ -1221,6 +1270,11 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
return eStructuralFeature.getEType().getInstanceClassName() == "java.util.Map$Entry"; //$NON-NLS-1$
}
+ private boolean isRootResource()
+ {
+ return this instanceof CDOResource && ((CDOResource)this).isRoot();
+ }
+
private void initClassInfo(EClass eClass)
{
InternalCDOClassInfo classInfo = (InternalCDOClassInfo)CDOModelUtil.getClassInfo(eClass);

Back to the top