|
|
|
Re: [Teneo] Storing references to Ecore Model Elements - External annotation [message #656643 is a reply to message #656385] |
Sun, 27 February 2011 21:01 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Fernando,
I think that this error occurs because EMF tries to save the eclass and assumes that the eclass must be in a resource
to. This error seems to be thrown before the hibernate save occurs. Let me know if the latest build still has this error.
gr. Martin
On 02/25/2011 12:50 PM, Fer wrote:
> Hello,
>
> A little more information to my previous post.
>
> I am trying another method using persistence.xml file:
>
> <?xml version="1.0" encoding="utf-8"?>
> <persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
> <epackage namespace-uri="http://www.vsd-project.org/vsd/ir5">
>
> <eclass name="EngineeringDataCategory">
> <property name="relatedItem">
> <type type=" org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e "/>
> </property>
> <property name="validItem">
> <type type=" org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e "/>
> </property>
> </eclass>
>
> </epackage>
>
> </persistence-mapping>
>
> Fragment of the ecore:
>
> <eClassifiers xsi:type="ecore:EClass" name="EngineeringDataCategory" eSuperTypes="//viewdata/IGraphicalDataItem">
> <eAnnotations source="http://www.vsd-project.org/vsee/annotation/stereotype">
> <details key="name" value="ConceptData"/>
> </eAnnotations>
> <eAnnotations source="http://www.vsd-project.org/vsee/annotation/dependencies">
> <details key="193721" value="self.assignment"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" unique="false" eType="//Description"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="isAbstract" unique="false" eType="//Boolean"
> defaultValueLiteral="false"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="multiplicity" unique="false" eType="//CategoryMultiplicity"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="assignment" upperBound="-1"
> eOpposite="//CategoryAssignment/category">
> <eAnnotations source="http://www.vsd-project.org/vsee/annotation/technical">
> <details key="linkType" value="Target"/>
> </eAnnotations>
> <eType xsi:type="ecore:EClass" href=" /de.scopeset.vsd.ssde.generator/models/vsee.cgf.ecore#//Cate goryAssignment "/>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="relatedItem" upperBound="-1">
> <eAnnotations source="http://www.vsd-project.org/vsee/annotation/technical">
> <details key="meta-type"
> value=" vsee.eClass().ePackage.getEClassifier('EngineeringDataItem') .oclAsType(ecore::EClass).isSuperTypeOf(self) "/>
> </eAnnotations>
> <eType xsi:type="ecore:EClass" href=" platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Class "/>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="validItem" upperBound="-1">
> <eAnnotations source="http://www.vsd-project.org/vsee/annotation/technical">
> <details key="meta-type"
> value=" vsee.eClass().ePackage.getEClassifier('EngineeringDataItem') .oclAsType(ecore::EClass).isSuperTypeOf(self) "/>
> </eAnnotations>
> <eType xsi:type="ecore:EClass" href=" platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Class "/>
> </eStructuralFeatures>
> </eClassifiers>
>
> But I get the following error:
>
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: The object 'org.eclipse.emf.ecore.impl.EClassImpl@1f546ee
> (name: null) (instanceClassName: null) (abstract: false, interface: false)' is not contained in a resource.
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.endSave(XMLSaveIm pl.java:306)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl. java:270)
> at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLRes ourceImpl.java:206)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:1406)
> at es.gmv.vsd.ssrdb.common.util.impl.CommonUtilImpl.getXMIBytes FromResource(CommonUtilImpl.java:222)
> at es.gmv.vsd.ssrdb.common.dao.impl.ds.DataSetVSEEDAO.get(DataS etVSEEDAO.java:211)
> at es.gmv.vsd.ssrdb.common.dao.impl.cm.ConfigManagementDAO.read DataSetXMI(ConfigManagementDAO.java:1861)
> at es.gmv.vsd.ssrdb.cm.impl.ConfigManagementImpl.readDataSetXMI (ConfigManagementImpl.java:761)
> at es.gmv.vsd.ssrdb.auditing.impl.AuditingImpl.readDataSetXMI(A uditingImpl.java:808)
> at es.gmv.vsd.ssrdb.mmi.impl.ManagerImpl.executeMethod(ManagerI mpl.java:685)
> at es.gmv.vsd.ssrdb.mmi.impl.ManagerImpl.run(ManagerImpl.java:1 23)
> Caused by: org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'org.eclipse.emf.ecore.impl.EClassImpl@1f546ee
> (name: null) (instanceClassName: null) (abstract: false, interface: false)' is not contained in a resource.
> at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.handleDanglingH REF(XMLHelperImpl.java:760)
> at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getURIFragment( XMLHelperImpl.java:731)
> at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getIDREF(XMLHel perImpl.java:753)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveIDRefMany(XML SaveImpl.java:2003)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLS aveImpl.java:1355)
> at org.vsdproject.datacore.vsee.resource.VSEEXMIResource$VSEEXM ISave.saveElementID(VSEEXMIResource.java:24)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1174)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1035)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany (XMLSaveImpl.java:2386)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLS aveImpl.java:1533)
> at org.vsdproject.datacore.vsee.resource.VSEEXMIResource$VSEEXM ISave.saveElementID(VSEEXMIResource.java:24)
> at org.eclipse.emf.ecore.xmi.impl.XMISaveImpl.writeTopObjects(X MISaveImpl.java:90)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveI mpl.java:592)
> at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl. java:256)
> ... 9 more
>
> Best Regards,
>
> Fernando
>
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
|
Re: [Teneo] Storing references to Ecore Model Elements - External annotation [message #656771 is a reply to message #656748] |
Mon, 28 February 2011 14:29 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Fernando,
Hmm, and if you try something like this:
<property name="relatedItem">
<external> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e </external>
</property>
gr. Martin
On 02/28/2011 01:44 PM, Fer wrote:
> Dear Martin,
>
> Thank you very much for your reply. With the new build (1.2.0.v201102272039) work perfectly (adding the @External
> annotations in Ecore file)! :)
>
> But I have tried to add the annotations from the persistence-mapping.xml file and does not work. Please, see below my
> persistence file:
>
> <?xml version="1.0" encoding="utf-8"?>
> <persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
> <epackage namespace-uri="http://www.vsd-project.org/vsd/ir5">
>
> <eclass name="EngineeringDataCategory">
> <property name="relatedItem">
> <type type=" org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e "/>
> </property>
> <property name="validItem">
> <type type=" org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e "/>
> </property>
> </eclass>
>
> </epackage>
>
> </persistence-mapping>
>
> The file is read correctly, but then does nothing. Both properties (relatedItem and validItem) are list. What do you think?
> Best Regards,
>
> Fernando
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
|
Powered by
FUDForum. Page generated in 0.04358 seconds