[xtend] bidrectional references not set with two ecore models [message #625843] |
Wed, 22 September 2010 06:36  |
Eclipse User |
|
|
|
Hello
I have two ecore models where one extends from the other.
I am trying to set a bidirectional reference between two elements with xtend, which works fine if I would be using only one ecore model.
PPP and AAA are elements of model Base
PPP references AAA
BBB is an element of model Extended
BBB extends from AAA
In xtend the following code
let bbb = new BBB :
bbb.setPpp(new PPP)
creates an error message
The value of type 'org.eclipse.emf.ecore.impl.EClassImpl@48edb5 (name: PPP) (instanceClassName: null) (abstract: false, interface: false)' must be of type 'org.eclipse.emf.ecore.impl.EClassImpl@1049d3 (name: PPP) (instanceClassName: null) (abstract: false, interface: false)'
Any help would be appreciated
Thanks
Richard
Ecore models attached
<?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="Base"
nsURI="http:///Base.ecore" nsPrefix="Base">
<eClassifiers xsi:type="ecore:EClass" name="AAA">
<eStructuralFeatures xsi:type="ecore:EReference" name="ppp" ordered="false" unique="false"
eType="#//PPP" eOpposite="#//PPP/aaa"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PPP">
<eStructuralFeatures xsi:type="ecore:EReference" name="aaa" ordered="false" unique="false"
upperBound="-1" eType="#//AAA" containment="true" eOpposite="#//AAA/ppp"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</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="Extended"
nsURI="http:///Extended.ecore" nsPrefix="Extended">
<eClassifiers xsi:type="ecore:EClass" name="BBB" eSuperTypes="Base.ecore#//AAA"/>
</ecore:EPackage>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03621 seconds