Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-10-18 03:48:25 -0400
committerEike Stepper2018-10-18 03:48:25 -0400
commit1e272a47e8da690ce4f56ce2126c6f7f0f3fb9cc (patch)
treeef23179da396c7b3a5328fa29a0cbc6bcff7fa45 /plugins/org.eclipse.emf.cdo.tests.db
parent6ee2bc3692ee826fc294a76d4846b54c03befb88 (diff)
downloadcdo-1e272a47e8da690ce4f56ce2126c6f7f0f3fb9cc.tar.gz
cdo-1e272a47e8da690ce4f56ce2126c6f7f0f3fb9cc.tar.xz
cdo-1e272a47e8da690ce4f56ce2126c6f7f0f3fb9cc.zip
[256856] Support model evolution
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256856
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.db')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 ALL) with ServerBrowser.launch2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/evolution/company1.evolution553
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/evolution/model1.ecore92
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/EvolutionTest.java618
7 files changed, 1275 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 ALL) with ServerBrowser.launch b/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 ALL) with ServerBrowser.launch
index bed44a829c..11e5075ba1 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 ALL) with ServerBrowser.launch
+++ b/plugins/org.eclipse.emf.cdo.tests.db/CDO AllTests (H2 ALL) with ServerBrowser.launch
@@ -16,5 +16,5 @@
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.db.AllTestsDBH2All"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests.db"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx2G&#13;&#10;-Dorg.eclipse.net4j.util.om.trace.disable=true&#13;&#10;-Dorg.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx2G&#13;&#10;-Dorg.eclipse.net4j.util.om.trace.disable=true&#13;&#10;-Dorg.eclipse.emf.cdo.tests.config.impl.RepositoryConfig.enableServerBrowser=true&#13;&#10;-Dorg.eclipse.emf.cdo.server.db.zipPackageBytes=true"/>
</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF
index fd6cbbf3f1..1b0cb3e820 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.tests.db/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.tests.db;singleton:=true
-Bundle-Version: 4.0.700.qualifier
+Bundle-Version: 4.0.800.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -27,12 +27,12 @@ Import-Package: com.mysql.jdbc.jdbc2.optional;version="[5.0.0,6.0.0)",
org.hsqldb.jdbc;version="[2.0.0,3.0.0)",
org.postgresql.ds;version="[9.0.0,10.0.0)",
org.postgresql.ds.common;version="[9.0.0,10.0.0)"
-Export-Package: org.eclipse.emf.cdo.tests.db;version="4.0.700";x-friends:="org.eclipse.emf.cdo.tests.all",
- org.eclipse.emf.cdo.tests.db.bugzilla;version="4.0.700";x-friends:="org.eclipse.emf.cdo.tests.all",
- org.eclipse.emf.cdo.tests.db.bundle;version="4.0.700";x-internal:=true,
- org.eclipse.emf.cdo.tests.db.capabilities;version="4.0.700";x-friends:="org.eclipse.emf.cdo.tests.all",
- org.eclipse.emf.cdo.tests.db.offline;version="4.0.700";x-friends:="org.eclipse.emf.cdo.tests.all",
- org.eclipse.emf.cdo.tests.db.performance;version="4.0.700";x-friends:="org.eclipse.emf.cdo.tests.all",
- org.eclipse.emf.cdo.tests.db.revisioncache;version="4.0.700";x-friends:="org.eclipse.emf.cdo.tests.all",
- org.eclipse.emf.cdo.tests.db.verifier;version="4.0.700";x-friends:="org.eclipse.emf.cdo.tests.all"
+Export-Package: org.eclipse.emf.cdo.tests.db;version="4.0.800";x-friends:="org.eclipse.emf.cdo.tests.all",
+ org.eclipse.emf.cdo.tests.db.bugzilla;version="4.0.800";x-friends:="org.eclipse.emf.cdo.tests.all",
+ org.eclipse.emf.cdo.tests.db.bundle;version="4.0.800";x-internal:=true,
+ org.eclipse.emf.cdo.tests.db.capabilities;version="4.0.800";x-friends:="org.eclipse.emf.cdo.tests.all",
+ org.eclipse.emf.cdo.tests.db.offline;version="4.0.800";x-friends:="org.eclipse.emf.cdo.tests.all",
+ org.eclipse.emf.cdo.tests.db.performance;version="4.0.800";x-friends:="org.eclipse.emf.cdo.tests.all",
+ org.eclipse.emf.cdo.tests.db.revisioncache;version="4.0.800";x-friends:="org.eclipse.emf.cdo.tests.all",
+ org.eclipse.emf.cdo.tests.db.verifier;version="4.0.800";x-friends:="org.eclipse.emf.cdo.tests.all"
Automatic-Module-Name: org.eclipse.emf.cdo.tests.db
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/evolution/company1.evolution b/plugins/org.eclipse.emf.cdo.tests.db/evolution/company1.evolution
new file mode 100644
index 0000000000..a30351348e
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.db/evolution/company1.evolution
@@ -0,0 +1,553 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<evolution:Evolution 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" xmlns:evolution="http://www.eclipse.org/emf/CDO/evolution/1.0.0">
+ <models uRI="platform:/resource/org.eclipse.emf.cdo.examples.company/model/company.ecore"/>
+ <models uRI="platform:/resource/org.eclipse.emf.cdo.examples.company/model/extended.ecore"/>
+ <releases version="1" date="2018-08-17T16:09:03.828+0200">
+ <rootPackages name="extended" nsURI="http://www.eclipse.org/emf/CDO/examples/extended/1.0.0" nsPrefix="extended">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWfmEKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="ExtendedCompany" eSuperTypes="//@releases.0/@rootPackages.1/Company">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWfmEaImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="employees" upperBound="-1" eType="//@releases.0/@rootPackages.0/Employee" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWfmEqImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Employee" eSuperTypes="//@releases.0/@rootPackages.1/Addressable">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWfmE6ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="salary">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWgNIKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ </rootPackages>
+ <rootPackages name="company" nsURI="http://www.eclipse.org/emf/CDO/examples/company/1.0.0" nsPrefix="company">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@hbGenericGenerators({@GenericGenerator(name=&quot;system-uuid&quot;, strategy = &quot;org.eclipse.emf.cdo.examples.hibernate.server.CDOExampleUUIDHexGenerator&quot;)})"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatwKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="Addressable" abstract="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatwaImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatwqImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="street">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatw6ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="city">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatxKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Company" eSuperTypes="//@releases.0/@rootPackages.1/Addressable">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatxaImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1" eType="//@releases.0/@rootPackages.1/Category" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatxqImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="suppliers" upperBound="-1" eType="//@releases.0/@rootPackages.1/Supplier" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatx6ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="customers" upperBound="-1" eType="//@releases.0/@rootPackages.1/Customer" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatyKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1" eType="//@releases.0/@rootPackages.1/PurchaseOrder" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatyaImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1" eType="//@releases.0/@rootPackages.1/SalesOrder" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU0KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Supplier" eSuperTypes="//@releases.0/@rootPackages.1/Addressable">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU0aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1" eType="//@releases.0/@rootPackages.1/PurchaseOrder" eOpposite="//@releases.0/@rootPackages.1/PurchaseOrder/supplier">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU0qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="preferred" defaultValueLiteral="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU06ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Customer" eSuperTypes="//@releases.0/@rootPackages.1/Addressable">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU1KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1" eType="//@releases.0/@rootPackages.1/SalesOrder" eOpposite="//@releases.0/@rootPackages.1/SalesOrder/customer">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU1aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Order">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Entity(name=&quot;BaseOrder&quot;)"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU1qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1" eType="//@releases.0/@rootPackages.1/OrderDetail" containment="true" eOpposite="//@releases.0/@rootPackages.1/OrderDetail/order">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU16ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="OrderDetail">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU2KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="order" lowerBound="1" eType="//@releases.0/@rootPackages.1/Order" eOpposite="//@releases.0/@rootPackages.1/Order/orderDetails">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU2aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="product" eType="//@releases.0/@rootPackages.1/Product" eOpposite="//@releases.0/@rootPackages.1/Product/orderDetails">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU2qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="price">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU26ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="PurchaseOrder" eSuperTypes="//@releases.0/@rootPackages.1/Order">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU3KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="date">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU3aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="supplier" lowerBound="1" eType="//@releases.0/@rootPackages.1/Supplier" eOpposite="//@releases.0/@rootPackages.1/Supplier/purchaseOrders">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU3qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="SalesOrder" eSuperTypes="//@releases.0/@rootPackages.1/Order">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU36ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU4KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="customer" lowerBound="1" eType="//@releases.0/@rootPackages.1/Customer" eOpposite="//@releases.0/@rootPackages.1/Customer/salesOrders">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU4aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Category">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU4qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Id @GeneratedValue(generator=&quot;system-uuid&quot;)"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU46ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1" eType="//@releases.0/@rootPackages.1/Category" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU5KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="products" upperBound="-1" eType="//@releases.0/@rootPackages.1/Product" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU5aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Product">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU5qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Id"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU56ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1" eType="//@releases.0/@rootPackages.1/OrderDetail" eOpposite="//@releases.0/@rootPackages.1/OrderDetail/product">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU6KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="vat" eType="//@releases.0/@rootPackages.1/VAT" defaultValueLiteral="vat15">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Basic(optional=false)&#xA;@Column(nullable=false)"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU6aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" transient="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU6qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="price">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU66ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="VAT">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU7KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eLiterals name="vat0">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU7aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eLiterals>
+ <eLiterals name="vat7" value="7">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU7qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eLiterals>
+ <eLiterals name="vat15" value="15">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU76ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eLiterals>
+ </eClassifiers>
+ </rootPackages>
+ </releases>
+ <releases version="2" date="2018-09-16T11:38:02.913+0200">
+ <rootPackages name="company" nsURI="http://www.eclipse.org/emf/CDO/examples/company/1.0.0" nsPrefix="company">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@hbGenericGenerators({@GenericGenerator(name=&quot;system-uuid&quot;, strategy = &quot;org.eclipse.emf.cdo.examples.hibernate.server.CDOExampleUUIDHexGenerator&quot;)})"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatwKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="Addressable" abstract="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatwaImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatwqImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="street">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatw6ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="city">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatxKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Company" eSuperTypes="//@releases.1/@rootPackages.0/Addressable">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatxaImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1" eType="//@releases.1/@rootPackages.0/Category" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatxqImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="suppliers" upperBound="-1" eType="//@releases.1/@rootPackages.0/Supplier" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatx6ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="customers" upperBound="-1" eType="//@releases.1/@rootPackages.0/Customer" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatyKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1" eType="//@releases.1/@rootPackages.0/PurchaseOrder" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEatyaImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1" eType="//@releases.1/@rootPackages.0/SalesOrder" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU0KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Supplier" eSuperTypes="//@releases.1/@rootPackages.0/Addressable">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU0aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1" eType="//@releases.1/@rootPackages.0/PurchaseOrder" eOpposite="//@releases.1/@rootPackages.0/PurchaseOrder/supplier">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU0qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="preferred" defaultValueLiteral="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU06ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Customer" eSuperTypes="//@releases.1/@rootPackages.0/Addressable">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU1KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1" eType="//@releases.1/@rootPackages.0/SalesOrder" eOpposite="//@releases.1/@rootPackages.0/SalesOrder/customer">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU1aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Order">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Entity(name=&quot;BaseOrder&quot;)"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU1qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1" eType="//@releases.1/@rootPackages.0/OrderDetail" containment="true" eOpposite="//@releases.1/@rootPackages.0/OrderDetail/order">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU16ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="OrderDetail">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU2KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="order" lowerBound="1" eType="//@releases.1/@rootPackages.0/Order" eOpposite="//@releases.1/@rootPackages.0/Order/orderDetails">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU2aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="product" eType="//@releases.1/@rootPackages.0/Product" eOpposite="//@releases.1/@rootPackages.0/Product/orderDetails">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU2qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="price">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU26ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="PurchaseOrder" eSuperTypes="//@releases.1/@rootPackages.0/Order">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU3KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="date">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU3aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="supplier" lowerBound="1" eType="//@releases.1/@rootPackages.0/Supplier" eOpposite="//@releases.1/@rootPackages.0/Supplier/purchaseOrders">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU3qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="SalesOrder" eSuperTypes="//@releases.1/@rootPackages.0/Order">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU36ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU4KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="customer" lowerBound="1" eType="//@releases.1/@rootPackages.0/Customer" eOpposite="//@releases.1/@rootPackages.0/Customer/salesOrders">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU4aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Category">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU4qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Id @GeneratedValue(generator=&quot;system-uuid&quot;)"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU46ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1" eType="//@releases.1/@rootPackages.0/Category" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU5KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="products" upperBound="-1" eType="//@releases.1/@rootPackages.0/Product" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU5aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Product">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU5qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Id"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU56ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1" eType="//@releases.1/@rootPackages.0/OrderDetail" eOpposite="//@releases.1/@rootPackages.0/OrderDetail/product">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU6KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="vat" eType="//@releases.1/@rootPackages.0/VAT" defaultValueLiteral="vat15">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Basic(optional=false)&#xA;@Column(nullable=false)"/>
+ </eAnnotations>
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU6aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" transient="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU6qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="price">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU66ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="VAT">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU7KImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eLiterals name="vat0">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU7aImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eLiterals>
+ <eLiterals name="vat7" value="7">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU7qImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eLiterals>
+ <eLiterals name="vat15" value="15">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_IEbU76ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eLiterals>
+ </eClassifiers>
+ </rootPackages>
+ <rootPackages name="extended" nsURI="http://www.eclipse.org/emf/CDO/examples/extended/1.0.0/v2" nsPrefix="extended">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWfmEKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="CompanyWithEmployees" eSuperTypes="//@releases.1/@rootPackages.0/Company">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWfmEaImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="employees" upperBound="-1" eType="//@releases.1/@rootPackages.1/Employee" containment="true">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWfmEqImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="code">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_c13uAKInEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EByte"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="salary">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="oldValue" value="_DWgNIKImEeiVxYbQv5gQdw"/>
+ <details key="value" value="_uqFJUKUCEeiGSu5PVxFtGQ"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Employee" eSuperTypes="//@releases.1/@rootPackages.0/Addressable">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWfmE6ImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="salary">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="value" value="_DWgNIKImEeiVxYbQv5gQdw"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="salary2">
+ <eAnnotations source="http://www.eclipse.org/CDO/evolution/ID">
+ <details key="oldValue" value="_DWgNIKImEeiVxYbQv5gQdw"/>
+ <details key="value" value="_D1TTgKRLEeiiEtXzDT3l2w"/>
+ </eAnnotations>
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ </rootPackages>
+ </releases>
+</evolution:Evolution>
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/evolution/model1.ecore b/plugins/org.eclipse.emf.cdo.tests.db/evolution/model1.ecore
new file mode 100644
index 0000000000..e839a2bd23
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.db/evolution/model1.ecore
@@ -0,0 +1,92 @@
+<?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="model1" nsURI="http://www.eclipse.org/EvolutionTest/model1"
+ nsPrefix="model1">
+ <eClassifiers xsi:type="ecore:EClass" name="Address">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="street" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="city" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Company" eSuperTypes="#//Address">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1"
+ eType="#//Category" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="suppliers" upperBound="-1"
+ eType="#//Supplier" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="customers" upperBound="-1"
+ eType="#//Customer" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1"
+ eType="#//PurchaseOrder" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1"
+ eType="#//SalesOrder" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Supplier" eSuperTypes="#//Address">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1"
+ eType="#//PurchaseOrder" eOpposite="#//PurchaseOrder/supplier"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="preferred" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+ defaultValueLiteral="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Customer" eSuperTypes="#//Address">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1"
+ eType="#//SalesOrder" eOpposite="#//SalesOrder/customer"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="orderByProduct" upperBound="-1"
+ eType="#//ProductToOrder" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Order" abstract="true">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1"
+ eType="#//OrderDetail" containment="true" eOpposite="#//OrderDetail/order"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="OrderDetail">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="order" lowerBound="1" eType="#//Order"
+ eOpposite="#//Order/orderDetails"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="product" eType="#//Product1"
+ eOpposite="#//Product1/orderDetails"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="price" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="PurchaseOrder" eSuperTypes="#//Order">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="date" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="supplier" lowerBound="1"
+ eType="#//Supplier" eOpposite="#//Supplier/purchaseOrders"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="salesOrders" upperBound="-1"
+ eType="#//SalesOrder" eOpposite="#//SalesOrder/purchaseOrders"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="SalesOrder" eSuperTypes="#//Order">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="customer" lowerBound="1"
+ eType="#//Customer" eOpposite="#//Customer/salesOrders"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="purchaseOrders" upperBound="-1"
+ eType="#//PurchaseOrder" eOpposite="#//PurchaseOrder/salesOrders"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Category">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="categories" upperBound="-1"
+ eType="#//Category" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="products" upperBound="-1"
+ eType="#//Product1" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Product1">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="teneo.jpa">
+ <details key="value" value="@Id"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="orderDetails" upperBound="-1"
+ eType="#//OrderDetail" eOpposite="#//OrderDetail/product"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="vat" eType="#//VAT" defaultValueLiteral="vat15"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="otherVATs" upperBound="-1"
+ eType="#//VAT" defaultValueLiteral="vat15"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ transient="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="VAT">
+ <eLiterals name="vat0"/>
+ <eLiterals name="vat7" value="7"/>
+ <eLiterals name="vat15" value="15"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="OrderAddress" eSuperTypes="#//Address #//Order #//OrderDetail">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testAttribute" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ProductToOrder" instanceClassName="java.util.Map$Entry">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="key" eType="#//Product1"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="value" eType="#//SalesOrder"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/pom.xml b/plugins/org.eclipse.emf.cdo.tests.db/pom.xml
index 47f318f5b7..18a141a86b 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/pom.xml
+++ b/plugins/org.eclipse.emf.cdo.tests.db/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo.tests.db</artifactId>
- <version>4.0.700-SNAPSHOT</version>
+ <version>4.0.800-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java
index 0d076140b6..ef99baea0c 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBConfigs.java
@@ -49,6 +49,7 @@ public abstract class DBConfigs extends AllConfigs
testClasses.add(DBStoreTest.class);
testClasses.add(CustomTypeMappingTest.class);
testClasses.add(SQLQueryTest.class);
+ testClasses.add(EvolutionTest.class);
super.initTestClasses(testClasses, scenario);
testClasses.remove(MEMStoreQueryTest.class);
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/EvolutionTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/EvolutionTest.java
new file mode 100644
index 0000000000..339e1389d2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/EvolutionTest.java
@@ -0,0 +1,618 @@
+/*
+ * Copyright (c) 2018 Eike Stepper (Loehne, 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.db;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
+import org.eclipse.emf.cdo.common.model.EMFUtil;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.evolution.Evolution;
+import org.eclipse.emf.cdo.evolution.EvolutionFactory;
+import org.eclipse.emf.cdo.evolution.Model;
+import org.eclipse.emf.cdo.evolution.Release;
+import org.eclipse.emf.cdo.server.StoreThreadLocal;
+import org.eclipse.emf.cdo.server.spi.evolution.AbstractMigrationContext;
+import org.eclipse.emf.cdo.server.spi.evolution.EvolutionSupport;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.CleanRepositoriesBefore;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.util.CDOUtil;
+
+import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.om.monitor.Monitor;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import java.io.File;
+
+/**
+ * @author Eike Stepper
+ */
+@CleanRepositoriesBefore(reason = "Needs clean package registry")
+public class EvolutionTest extends AbstractCDOTest
+{
+ private Model createEvolution(String modelPath)
+ {
+ String modelName = URI.createFileURI(modelPath).trimFileExtension().lastSegment();
+ String tempFolder = createTempFolder(getTestMethodName() + "-").toString();
+ ResourceSet resourceSet = EMFUtil.newEcoreResourceSet();
+
+ Evolution evolution = EvolutionFactory.eINSTANCE.createEvolution();
+ URI evolutionURI = URI.createFileURI(tempFolder).appendSegment(modelName + ".evolution");
+ Resource evolutionResource = resourceSet.createResource(evolutionURI);
+ evolutionResource.getContents().add(evolution);
+
+ File modelFile = new File(tempFolder, modelName + ".ecore");
+ IOUtil.copyFile(new File(modelPath), modelFile);
+ URI modelURI = URI.createFileURI(modelFile.toString());
+ Model model = evolution.addModel(modelURI);
+
+ IOUtil.OUT().println("Evolution: " + evolutionURI.path());
+ IOUtil.OUT().println("Model: " + modelURI.path());
+ IOUtil.OUT().println();
+
+ evolution.ensureIDs();
+ evolution.save();
+
+ return model;
+ }
+
+ private void migrate(Release release)
+ {
+ AbstractMigrationContext context = new AbstractMigrationContext(release)
+ {
+ public void log(Object msg)
+ {
+ IOUtil.OUT().println(msg);
+ }
+ };
+
+ EvolutionSupport evolutionSupport = (EvolutionSupport)getRepository().getStore().getReader(null);
+ StoreThreadLocal.setAccessor(evolutionSupport);
+
+ try
+ {
+ context.migrate(evolutionSupport, new Monitor());
+ }
+ finally
+ {
+ StoreThreadLocal.release();
+ }
+ }
+
+ public void testInitialRelease() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ Release v1 = model.getEvolution().createRelease();
+ migrate(v1);
+
+ CDOSession session = openSession();
+
+ String nsURI = model.getRootPackage().getNsURI();
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ EObject company = new SessionPackage(nsURI).create("Company");
+ eSet(company, "name", "ESC");
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(company);
+ transaction.commit();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ CDOResource resource2 = transaction2.getOrCreateResource(getResourcePath("res"));
+ EObject company2 = resource2.getContents().get(0);
+ assertEquals("ESC", eGet(company2, "name"));
+ }
+
+ public void testAddClass() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ Evolution evolution = model.getEvolution();
+
+ Release v1 = evolution.createRelease();
+ migrate(v1);
+
+ EPackage ePackage = model.getRootPackage();
+
+ EClass eClass = EcoreFactory.eINSTANCE.createEClass();
+ eClass.setName("Employee");
+ eClass.getESuperTypes().add((EClass)ePackage.getEClassifier("Address"));
+
+ EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
+ eAttribute.setName("salary");
+ eAttribute.setEType(EcorePackage.Literals.EDOUBLE);
+
+ ePackage.getEClassifiers().add(eClass);
+
+ Release v2 = evolution.createRelease();
+ migrate(v2);
+
+ CDOSession session = openSession();
+
+ String nsURI = model.getRootPackage().getNsURI();
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ EObject employee = new SessionPackage(nsURI).create("Employee");
+ eSet(employee, "name", "Eike");
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(employee);
+ transaction.commit();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ CDOResource resource2 = transaction2.getOrCreateResource(getResourcePath("res"));
+ EObject employee2 = resource2.getContents().get(0);
+ assertEquals("Eike", eGet(employee2, "name"));
+ }
+
+ public void testRenameClass() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ Evolution evolution = model.getEvolution();
+
+ Release v1 = evolution.createRelease();
+ migrate(v1);
+
+ EPackage ePackage = model.getRootPackage();
+ EClass addressClass = (EClass)ePackage.getEClassifier("Address");
+ addressClass.setName("Addressable");
+
+ Release v2 = evolution.createRelease();
+ migrate(v2);
+
+ CDOSession session = openSession();
+
+ String nsURI = model.getRootPackage().getNsURI();
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ EObject addressable = new SessionPackage(nsURI).create("Addressable");
+ eSet(addressable, "name", "Somebody");
+
+ EObject customer = new SessionPackage(nsURI).create("Customer");
+ eSet(customer, "name", "Eike");
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(addressable);
+ resource.getContents().add(customer);
+ transaction.commit();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ CDOResource resource2 = transaction2.getOrCreateResource(getResourcePath("res"));
+
+ EObject addressable2 = resource2.getContents().get(0);
+ assertEquals("Addressable", addressable2.eClass().getName());
+ assertEquals("Somebody", eGet(addressable2, "name"));
+
+ EObject customer2 = resource2.getContents().get(1);
+ assertEquals("Customer", customer2.eClass().getName());
+ assertEquals("Eike", eGet(customer2, "name"));
+ session2.close();
+
+ ePackage = model.getRootPackage();
+ addressClass = (EClass)ePackage.getEClassifier("Addressable");
+ addressClass.setName("AddressableXXX");
+
+ Release v3 = evolution.createRelease();
+ migrate(v3);
+
+ CDOSession session3 = openSession();
+ CDOTransaction transaction3 = session3.openTransaction();
+ CDOResource resource3 = transaction3.getOrCreateResource(getResourcePath("res"));
+
+ EObject addressable3 = resource3.getContents().get(0);
+ assertEquals("AddressableXXX", addressable3.eClass().getName());
+ assertEquals("Somebody", eGet(addressable3, "name"));
+
+ EObject customer3 = resource3.getContents().get(1);
+ assertEquals("Customer", customer3.eClass().getName());
+ assertEquals("Eike", eGet(customer3, "name"));
+ session3.close();
+ }
+
+ public void testAddAttribute_SingleValued() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ String nsURI = model.getRootPackage().getNsURI();
+ Evolution evolution = model.getEvolution();
+
+ Release v1 = evolution.createRelease();
+ migrate(v1);
+
+ CDOSession session0 = openSession();
+ CDOTransaction transaction0 = session0.openTransaction();
+ CDOResource resource0 = transaction0.getOrCreateResource(getResourcePath("res"));
+ EObject customer0 = new SessionPackage(nsURI).create("Customer");
+ resource0.getContents().add(customer0);
+ transaction0.commit();
+ session0.close();
+
+ EPackage ePackage = model.getRootPackage();
+ EClass addressClass = (EClass)ePackage.getEClassifier("Address");
+
+ EAttribute zipCodeAttribute = EcoreFactory.eINSTANCE.createEAttribute();
+ zipCodeAttribute.setName("zipCode");
+ zipCodeAttribute.setEType(EcorePackage.Literals.EINT);
+
+ addressClass.getEStructuralFeatures().add(zipCodeAttribute);
+
+ Release v2 = evolution.createRelease();
+ migrate(v2);
+
+ CDOSession session = openSession();
+
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ EObject customer = new SessionPackage(nsURI).create("Customer");
+ eSet(customer, "zipCode", 32584);
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(customer);
+ transaction.commit();
+ CDOID customerID = CDOUtil.getCDOObject(customer).cdoID();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ EObject customer2 = transaction2.getObject(customerID);
+ assertEquals(32584, eGet(customer2, "zipCode"));
+ }
+
+ public void testAddAttribute_ManyValued() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ String nsURI = model.getRootPackage().getNsURI();
+ Evolution evolution = model.getEvolution();
+
+ Release v1 = evolution.createRelease();
+ migrate(v1);
+
+ CDOSession session0 = openSession();
+ CDOTransaction transaction0 = session0.openTransaction();
+ CDOResource resource0 = transaction0.getOrCreateResource(getResourcePath("res"));
+ EObject customer0 = new SessionPackage(nsURI).create("Customer");
+ resource0.getContents().add(customer0);
+ transaction0.commit();
+ session0.close();
+
+ EPackage ePackage = model.getRootPackage();
+ EClass addressClass = (EClass)ePackage.getEClassifier("Address");
+
+ EAttribute zipCodesAttribute = EcoreFactory.eINSTANCE.createEAttribute();
+ zipCodesAttribute.setName("zipCodes");
+ zipCodesAttribute.setEType(EcorePackage.Literals.EINT);
+ zipCodesAttribute.setUpperBound(-1);
+
+ addressClass.getEStructuralFeatures().add(zipCodesAttribute);
+
+ Release v2 = evolution.createRelease();
+ migrate(v2);
+
+ CDOSession session = openSession();
+
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ EObject customer = new SessionPackage(nsURI).create("Customer");
+ eAdd(customer, "zipCodes", 32584);
+ eAdd(customer, "zipCodes", 10243);
+ eAdd(customer, "zipCodes", 10777);
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(customer);
+ transaction.commit();
+ CDOID customerID = CDOUtil.getCDOObject(customer).cdoID();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ EObject customer2 = transaction2.getObject(customerID);
+ assertEquals(32584, (int)(Integer)eGet(customer2, "zipCodes", 0));
+ assertEquals(10243, (int)(Integer)eGet(customer2, "zipCodes", 1));
+ assertEquals(10777, (int)(Integer)eGet(customer2, "zipCodes", 2));
+ }
+
+ public void testRenameAttribute_SingleValued() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ String nsURI = model.getRootPackage().getNsURI();
+ Evolution evolution = model.getEvolution();
+
+ Release v1 = evolution.createRelease();
+ migrate(v1);
+
+ CDOSession session0 = openSession();
+ CDOTransaction transaction0 = session0.openTransaction();
+ CDOResource resource0 = transaction0.getOrCreateResource(getResourcePath("res"));
+ EObject customer0 = new SessionPackage(nsURI).create("Customer");
+ resource0.getContents().add(customer0);
+ transaction0.commit();
+ session0.close();
+
+ EPackage ePackage = model.getRootPackage();
+ EClass addressClass = (EClass)ePackage.getEClassifier("Address");
+ addressClass.getEStructuralFeature("city").setName("zipCodeAndCity");
+
+ Release v2 = evolution.createRelease();
+ migrate(v2);
+
+ CDOSession session = openSession();
+
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ EObject customer = new SessionPackage(nsURI).create("Customer");
+ eSet(customer, "zipCodeAndCity", "32584 Loehne");
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(customer);
+ transaction.commit();
+ CDOID customerID = CDOUtil.getCDOObject(customer).cdoID();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ EObject customer2 = transaction2.getObject(customerID);
+ assertEquals("32584 Loehne", eGet(customer2, "zipCodeAndCity"));
+ }
+
+ public void testRenameAttribute_ManyValued() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ String nsURI = model.getRootPackage().getNsURI();
+ Evolution evolution = model.getEvolution();
+
+ Release v1 = evolution.createRelease();
+ migrate(v1);
+
+ CDOSession session0 = openSession();
+ CDOTransaction transaction0 = session0.openTransaction();
+ CDOResource resource0 = transaction0.getOrCreateResource(getResourcePath("res"));
+ SessionPackage sessionPackage0 = new SessionPackage(nsURI);
+ EObject company0 = sessionPackage0.create("Company");
+ resource0.getContents().add(company0);
+ eAdd(company0, "customers", sessionPackage0.create("Customer"));
+ transaction0.commit();
+ session0.close();
+
+ EPackage ePackage = model.getRootPackage();
+ EClass companyClass = (EClass)ePackage.getEClassifier("Company");
+ companyClass.getEStructuralFeature("customers").setName("esteemedCustomers");
+
+ Release v2 = evolution.createRelease();
+ migrate(v2);
+
+ CDOSession session = openSession();
+
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ SessionPackage sessionPackage = new SessionPackage(nsURI);
+ EObject company = sessionPackage.create("Company");
+ eAdd(company, "esteemedCustomers", sessionPackage.create("Customer"));
+ eAdd(company, "esteemedCustomers", sessionPackage.create("Customer"));
+ eAdd(company, "esteemedCustomers", sessionPackage.create("Customer"));
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(company);
+ transaction.commit();
+ CDOID companyID = CDOUtil.getCDOObject(company).cdoID();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ EObject company2 = transaction2.getObject(companyID);
+ EList<EObject> esteemedCustomers2 = eList(company2, "esteemedCustomers");
+ assertEquals("Customer", esteemedCustomers2.get(0).eClass().getName());
+ assertEquals("Customer", esteemedCustomers2.get(1).eClass().getName());
+ assertEquals("Customer", esteemedCustomers2.get(2).eClass().getName());
+ }
+
+ public void testAddReference_SingleValued() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ String nsURI = model.getRootPackage().getNsURI();
+ Evolution evolution = model.getEvolution();
+
+ Release v1 = evolution.createRelease();
+ migrate(v1);
+
+ CDOSession session0 = openSession();
+ CDOTransaction transaction0 = session0.openTransaction();
+ CDOResource resource0 = transaction0.getOrCreateResource(getResourcePath("res"));
+ EObject customer0 = new SessionPackage(nsURI).create("Customer");
+ resource0.getContents().add(customer0);
+ transaction0.commit();
+ session0.close();
+
+ EPackage ePackage = model.getRootPackage();
+ EClass addressClass = (EClass)ePackage.getEClassifier("Address");
+
+ EReference siteReference = EcoreFactory.eINSTANCE.createEReference();
+ siteReference.setName("site");
+ siteReference.setEType(addressClass);
+ siteReference.setContainment(true);
+
+ addressClass.getEStructuralFeatures().add(siteReference);
+
+ Release v2 = evolution.createRelease();
+ migrate(v2);
+
+ CDOSession session = openSession();
+
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ SessionPackage sessionPackage = new SessionPackage(nsURI);
+ EObject customer = sessionPackage.create("Customer");
+ eSet(customer, "site", sessionPackage.create("Customer"));
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(customer);
+ transaction.commit();
+ CDOID customerID = CDOUtil.getCDOObject(customer).cdoID();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ EObject customer2 = transaction2.getObject(customerID);
+ EObject site2 = eGet(customer2, "site");
+ assertEquals("Customer", site2.eClass().getName());
+ }
+
+ public void testAddReference_ManyValued() throws Exception
+ {
+ // InternalRepository repository = getRepository();
+ // IDBStore store = (IDBStore)repository.getStore();
+ // IDBSchema schema = store.getDatabase().getSchema();
+ // IMappingStrategy mappingStrategy = store.getMappingStrategy();
+
+ Model model = createEvolution("evolution/model1.ecore");
+ String nsURI = model.getRootPackage().getNsURI();
+ Evolution evolution = model.getEvolution();
+
+ Release v1 = evolution.createRelease();
+ migrate(v1);
+
+ CDOSession session0 = openSession();
+ CDOTransaction transaction0 = session0.openTransaction();
+ CDOResource resource0 = transaction0.getOrCreateResource(getResourcePath("res"));
+ EObject customer0 = new SessionPackage(nsURI).create("Customer");
+ resource0.getContents().add(customer0);
+ transaction0.commit();
+ session0.close();
+
+ EPackage ePackage = model.getRootPackage();
+ EClass addressClass = (EClass)ePackage.getEClassifier("Address");
+
+ EReference sitesReference = EcoreFactory.eINSTANCE.createEReference();
+ sitesReference.setName("sites");
+ sitesReference.setEType(addressClass);
+ sitesReference.setContainment(true);
+ sitesReference.setUpperBound(-1);
+
+ addressClass.getEStructuralFeatures().add(sitesReference);
+
+ Release v2 = evolution.createRelease();
+ migrate(v2);
+
+ CDOSession session = openSession();
+
+ CDOPackageUnit packageUnit = session.getPackageRegistry().getPackageUnit(nsURI);
+ assertNotNull(packageUnit);
+
+ SessionPackage sessionPackage = new SessionPackage(nsURI);
+ EObject customer = sessionPackage.create("Customer");
+ eAdd(customer, "sites", sessionPackage.create("Customer"));
+ eAdd(customer, "sites", sessionPackage.create("Customer"));
+ eAdd(customer, "sites", sessionPackage.create("Customer"));
+
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("res"));
+ resource.getContents().add(customer);
+ transaction.commit();
+ CDOID customerID = CDOUtil.getCDOObject(customer).cdoID();
+ session.close();
+
+ CDOSession session2 = openSession();
+ CDOTransaction transaction2 = session2.openTransaction();
+ EObject customer2 = transaction2.getObject(customerID);
+ assertEquals(3, eList(customer2, "sites").size());
+ }
+
+ public void _testNewPackageVersionWithSameNSURI() throws Exception
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void _testNewTransientFeature() throws Exception
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void _testAdditionalIndexes() throws Exception
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void _testRenameUnsettableFeature() throws Exception
+ {
+ throw new UnsupportedOperationException();
+ }
+}

Back to the top