Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Storing references to Ecore Model Elements - External annotation
[Teneo] Storing references to Ecore Model Elements - External annotation [message #656342] Fri, 25 February 2011 08:22 Go to next message
Fer Missing name is currently offline Fer Missing nameFriend
Messages: 24
Registered: September 2009
Junior Member
Hello all,

I am trying to create a @External annotation in the Ecore model:

<eStructuralFeatures xsi:type="ecore:EReference" name="relatedItem" upperBound="-1"
        eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EClass">
      <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>
      [B]<eAnnotations source="teneo.jpa">
        <details key="value" value="@External(type=&quot;org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType&quot;)"/>
      </eAnnotations>[/B]
    </eStructuralFeatures>


But I have the following error:

org.hibernate.MappingException: Unable to instantiate custom type: org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType
	at org.hibernate.type.TypeFactory.custom(TypeFactory.java:187)
	at org.hibernate.type.TypeFactory.custom(TypeFactory.java:174)
	at org.hibernate.type.TypeFactory.byClass(TypeFactory.java:99)
	at org.hibernate.type.TypeResolver.heuristicType(TypeResolver.java:130)
	at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:297)
	at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:290)
	at org.hibernate.mapping.Collection.validate(Collection.java:313)
	at org.hibernate.mapping.IndexedCollection.validate(IndexedCollection.java:90)
	at org.hibernate.cfg.Configuration.validate(Configuration.java:1336)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1835)
	at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSessionFactory(HbSessionDataStore.java:221)
	at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:96)
	at org.eclipse.emf.teneo.hibernate.HbBaseSessionDataStore.getSessionFactory(HbBaseSessionDataStore.java:74)
	at es.gmv.vsd.ssrdb.common.dao.impl.HibernateUtil.buildSessionFactory(HibernateUtil.java:151)
	at es.gmv.vsd.ssrdb.common.dao.impl.HibernateUtil.getSession(HibernateUtil.java:58)
	at es.gmv.vsd.ssrdb.common.dao.impl.ds.DataSetVSEEDAO.save(DataSetVSEEDAO.java:52)
	at es.gmv.vsd.ssrdb.common.dao.impl.cm.ConfigManagementDAO.createTrunk(ConfigManagementDAO.java:1395)
	at es.gmv.vsd.ssrdb.cm.impl.ConfigManagementImpl.createTrunk(ConfigManagementImpl.java:561)
	at es.gmv.vsd.ssrdb.auditing.impl.AuditingImpl.createTrunk(AuditingImpl.java:285)
	at es.gmv.vsd.ssrdb.mmi.impl.ManagerImpl.executeMethod(ManagerImpl.java:419)
	at es.gmv.vsd.ssrdb.mmi.impl.ManagerImpl.run(ManagerImpl.java:123)
Caused by: org.hibernate.MappingException: type is not parameterized: org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType
	at org.hibernate.type.TypeFactory.injectParameters(TypeFactory.java:130)
	at org.hibernate.type.TypeFactory.custom(TypeFactory.java:183)
	... 20 more


I'm trying to do what it says on the following lines:
Note that instead of using the Type annotation one can probably (==not-yet-tested) also use the External annotation (see section above) with the type attribute set to: org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e

Am I doing something wrong? It is correct to use a jpa annotation for this?

Thanks in advance.

Best Regards,

Fernando
Re: [Teneo] Storing references to Ecore Model Elements - External annotation [message #656385 is a reply to message #656342] Fri, 25 February 2011 11:50 Go to previous messageGo to next message
Fer Missing name is currently offline Fer Missing nameFriend
Messages: 24
Registered: September 2009
Junior Member
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.EcoreModelElementType"/>
			</property>
			<property name="validItem">
				<type type="org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType"/>
			</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#//CategoryAssignment"/>
    </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#//EClass"/>
    </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#//EClass"/>
    </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(XMLSaveImpl.java:306)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:270)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:206)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1406)
	at es.gmv.vsd.ssrdb.common.util.impl.CommonUtilImpl.getXMIBytesFromResource(CommonUtilImpl.java:222)
	at es.gmv.vsd.ssrdb.common.dao.impl.ds.DataSetVSEEDAO.get(DataSetVSEEDAO.java:211)
	at es.gmv.vsd.ssrdb.common.dao.impl.cm.ConfigManagementDAO.readDataSetXMI(ConfigManagementDAO.java:1861)
	at es.gmv.vsd.ssrdb.cm.impl.ConfigManagementImpl.readDataSetXMI(ConfigManagementImpl.java:761)
	at es.gmv.vsd.ssrdb.auditing.impl.AuditingImpl.readDataSetXMI(AuditingImpl.java:808)
	at es.gmv.vsd.ssrdb.mmi.impl.ManagerImpl.executeMethod(ManagerImpl.java:685)
	at es.gmv.vsd.ssrdb.mmi.impl.ManagerImpl.run(ManagerImpl.java:123)
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.handleDanglingHREF(XMLHelperImpl.java:760)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getURIFragment(XMLHelperImpl.java:731)
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getIDREF(XMLHelperImpl.java:753)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveIDRefMany(XMLSaveImpl.java:2003)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1355)
	at org.vsdproject.datacore.vsee.resource.VSEEXMIResource$VSEEXMISave.saveElementID(VSEEXMIResource.java:24)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1174)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1035)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2386)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1533)
	at org.vsdproject.datacore.vsee.resource.VSEEXMIResource$VSEEXMISave.saveElementID(VSEEXMIResource.java:24)
	at org.eclipse.emf.ecore.xmi.impl.XMISaveImpl.writeTopObjects(XMISaveImpl.java:90)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:592)
	at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:256)
	... 9 more


Best Regards,

Fernando


Re: [Teneo] Storing references to Ecore Model Elements - External annotation [message #656642 is a reply to message #656342] Sun, 27 February 2011 20:58 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Fernando,
Yes this was a bug. I solved it and published a new build. Let me know if this one still gives you troubles.

gr. Martin

On 02/25/2011 09:22 AM, Fer wrote:
> Hello all,
>
> I am trying to create a @External annotation in the Ecore model:
>
>
> <eStructuralFeatures xsi:type="ecore:EReference" name="relatedItem" upperBound="-1"
> eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E Class ">
> <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>
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@External(type=" org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e ")"/>
> </eAnnotations>

> </eStructuralFeatures>
>
>
> But I have the following error:
>
> org.hibernate.MappingException: Unable to instantiate custom type:
> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
> at org.hibernate.type.TypeFactory.custom(TypeFactory.java:187)
> at org.hibernate.type.TypeFactory.custom(TypeFactory.java:174)
> at org.hibernate.type.TypeFactory.byClass(TypeFactory.java:99)
> at org.hibernate.type.TypeResolver.heuristicType(TypeResolver.j ava:130)
> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 97)
> at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 90)
> at org.hibernate.mapping.Collection.validate(Collection.java:31 3)
> at org.hibernate.mapping.IndexedCollection.validate(IndexedColl ection.java:90)
> at org.hibernate.cfg.Configuration.validate(Configuration.java: 1336)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1835)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:221)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:96)
> at org.eclipse.emf.teneo.hibernate.HbBaseSessionDataStore.getSe ssionFactory(HbBaseSessionDataStore.java:74)
> at es.gmv.vsd.ssrdb.common.dao.impl.HibernateUtil.buildSessionF actory(HibernateUtil.java:151)
> at es.gmv.vsd.ssrdb.common.dao.impl.HibernateUtil.getSession(Hi bernateUtil.java:58)
> at es.gmv.vsd.ssrdb.common.dao.impl.ds.DataSetVSEEDAO.save(Data SetVSEEDAO.java:52)
> at es.gmv.vsd.ssrdb.common.dao.impl.cm.ConfigManagementDAO.crea teTrunk(ConfigManagementDAO.java:1395)
> at es.gmv.vsd.ssrdb.cm.impl.ConfigManagementImpl.createTrunk(Co nfigManagementImpl.java:561)
> at es.gmv.vsd.ssrdb.auditing.impl.AuditingImpl.createTrunk(Audi tingImpl.java:285)
> at es.gmv.vsd.ssrdb.mmi.impl.ManagerImpl.executeMethod(ManagerI mpl.java:419)
> at es.gmv.vsd.ssrdb.mmi.impl.ManagerImpl.run(ManagerImpl.java:1 23)
> Caused by: org.hibernate.MappingException: type is not parameterized:
> org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
> at org.hibernate.type.TypeFactory.injectParameters(TypeFactory. java:130)
> at org.hibernate.type.TypeFactory.custom(TypeFactory.java:183)
> ... 20 more
>
>
> I'm trying to do what it says on the following lines:
> Note that instead of using the Type annotation one can probably (==not-yet-tested) also use the External annotation (see
> section above) with the type attribute set to: org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementTyp e
>
> Am I doing something wrong? It is correct to use a jpa annotation for this?
>
> Thanks in advance.
>
> 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 #656643 is a reply to message #656385] Sun, 27 February 2011 21:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
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 #656748 is a reply to message #656643] Mon, 28 February 2011 12:44 Go to previous messageGo to next message
Fer Missing name is currently offline Fer Missing nameFriend
Messages: 24
Registered: September 2009
Junior Member
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)! Smile

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.EcoreModelElementType"/>
			</property>
			<property name="validItem">
				<type type="org.eclipse.emf.teneo.hibernate.mapping.EcoreModelElementType"/>
			</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
Re: [Teneo] Storing references to Ecore Model Elements - External annotation [message #656771 is a reply to message #656748] Mon, 28 February 2011 14:29 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
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
Re: [Teneo] Storing references to Ecore Model Elements - External annotation [message #656790 is a reply to message #656771] Mon, 28 February 2011 15:34 Go to previous message
Fer Missing name is currently offline Fer Missing nameFriend
Messages: 24
Registered: September 2009
Junior Member
Dear Martin,

Perfect!! Now works perfectly! Smile

Thank you very much for your help.

Best Regards,

Fernando

[Updated on: Mon, 28 February 2011 15:35]

Report message to a moderator

Previous Topic:[TENEO] Can Teneo migration from 1.0.3 to 1.2.x still read same DB data?
Next Topic:Instance of ECore Model
Goto Forum:
  


Current Time: Tue Apr 23 09:40:30 GMT 2024

Powered by FUDForum. Page generated in 0.04464 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top