Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Use several ecore file for the same model
[Teneo] Use several ecore file for the same model [message #128858] Wed, 20 August 2008 12:53 Go to next message
samuel is currently offline samuelFriend
Messages: 11
Registered: July 2009
Junior Member
Hello !

I want to persit a model with links to another ecore file.
In EMF we have the possibility to load another ecore within an existing
ecore, and to make references to this model.
Example : The ResourceExtendedTest extends a Resource defined in another
ecore file :

<eClassifiers xsi:type="ecore:EClass" name="ResourceExtendedTest"
eSuperTypes="../../../model/DreamsBasicModel.ecore#//Resource ">
</eClassifiers>

But when initializing (HbSessionDataStore.initialize ), It throws an
exception because it can't find the the Resource defined in the other ecore
file:
java.lang.IllegalArgumentException: No annotated model element present for:
Resource for type EClass has its epackage been registered with Teneo?
at
org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:346)
at
org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:288)
at
org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator.ann otate(EClassAnnotator.java:91)
at
org.eclipse.emf.teneo.hibernate.annotations.HbEClassAnnotato r.annotate(HbEClassAnnotator.java:55)
at
org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator .processPackage(AnnotationGenerator.java:167)
at
org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator .map(AnnotationGenerator.java:135)
at
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:142)
at
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:66)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:609)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:155)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:73)
at
org.eclipse.emf.teneo.hibernate.HbBaseSessionDataStore.getSe ssionFactory(HbBaseSessionDataStore.java:57)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.close(HbS essionDataStore.java:172)
at
com.oslo.dreams.model.util.ExtendedModelLoaderTest.testLoadM odel(ExtendedModelLoaderTest.java:38)

All the packages has been registered (even the packages defined in the other
ecore file).
Thanks in advance for your help,

Regards,

Samuel Michelot
Re: [Teneo] Use several ecore file for the same model [message #128885 is a reply to message #128858] Fri, 22 August 2008 16:26 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Samuel,
Sorry for the late reply, I was travelling and I had missed your post before that. Also support for
Teneo is given on the EMF newsgroup which I cc-ed.

Teneo does not resolve the references by itself. You need to tell the datastore which EPackages you
want to persist. All your epackages should be passed in the call to dataStore.setEPackages.

gr. Martin


Samuel Michelot wrote:
> Hello !
>
> I want to persit a model with links to another ecore file.
> In EMF we have the possibility to load another ecore within an existing
> ecore, and to make references to this model.
> Example : The ResourceExtendedTest extends a Resource defined in another
> ecore file :
>
> <eClassifiers xsi:type="ecore:EClass" name="ResourceExtendedTest"
> eSuperTypes="../../../model/DreamsBasicModel.ecore#//Resource ">
> </eClassifiers>
>
> But when initializing (HbSessionDataStore.initialize ), It throws an
> exception because it can't find the the Resource defined in the other ecore
> file:
> java.lang.IllegalArgumentException: No annotated model element present for:
> Resource for type EClass has its epackage been registered with Teneo?
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:346)
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:288)
> at
> org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator.ann otate(EClassAnnotator.java:91)
> at
> org.eclipse.emf.teneo.hibernate.annotations.HbEClassAnnotato r.annotate(HbEClassAnnotator.java:55)
> at
> org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator .processPackage(AnnotationGenerator.java:167)
> at
> org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator .map(AnnotationGenerator.java:135)
> at
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:142)
> at
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:66)
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:609)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:155)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:73)
> at
> org.eclipse.emf.teneo.hibernate.HbBaseSessionDataStore.getSe ssionFactory(HbBaseSessionDataStore.java:57)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.close(HbS essionDataStore.java:172)
> at
> com.oslo.dreams.model.util.ExtendedModelLoaderTest.testLoadM odel(ExtendedModelLoaderTest.java:38)
>
> All the packages has been registered (even the packages defined in the other
> ecore file).
> Thanks in advance for your help,
>
> Regards,
>
> Samuel Michelot
>
>
>


--

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] Use several ecore file for the same model [message #620248 is a reply to message #128858] Fri, 22 August 2008 16:26 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Samuel,
Sorry for the late reply, I was travelling and I had missed your post before that. Also support for
Teneo is given on the EMF newsgroup which I cc-ed.

Teneo does not resolve the references by itself. You need to tell the datastore which EPackages you
want to persist. All your epackages should be passed in the call to dataStore.setEPackages.

gr. Martin


Samuel Michelot wrote:
> Hello !
>
> I want to persit a model with links to another ecore file.
> In EMF we have the possibility to load another ecore within an existing
> ecore, and to make references to this model.
> Example : The ResourceExtendedTest extends a Resource defined in another
> ecore file :
>
> <eClassifiers xsi:type="ecore:EClass" name="ResourceExtendedTest"
> eSuperTypes="../../../model/DreamsBasicModel.ecore#//Resource ">
> </eClassifiers>
>
> But when initializing (HbSessionDataStore.initialize ), It throws an
> exception because it can't find the the Resource defined in the other ecore
> file:
> java.lang.IllegalArgumentException: No annotated model element present for:
> Resource for type EClass has its epackage been registered with Teneo?
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:346)
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:288)
> at
> org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator.ann otate(EClassAnnotator.java:91)
> at
> org.eclipse.emf.teneo.hibernate.annotations.HbEClassAnnotato r.annotate(HbEClassAnnotator.java:55)
> at
> org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator .processPackage(AnnotationGenerator.java:167)
> at
> org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator .map(AnnotationGenerator.java:135)
> at
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:142)
> at
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:66)
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:609)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:155)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:73)
> at
> org.eclipse.emf.teneo.hibernate.HbBaseSessionDataStore.getSe ssionFactory(HbBaseSessionDataStore.java:57)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.close(HbS essionDataStore.java:172)
> at
> com.oslo.dreams.model.util.ExtendedModelLoaderTest.testLoadM odel(ExtendedModelLoaderTest.java:38)
>
> All the packages has been registered (even the packages defined in the other
> ecore file).
> Thanks in advance for your help,
>
> Regards,
>
> Samuel Michelot
>
>
>


--

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
Previous Topic:EMF search returns duplicate results
Next Topic:[Teneo] Error running Teneo (1.x) Dynamic.java example
Goto Forum:
  


Current Time: Wed Apr 24 16:49:19 GMT 2024

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

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

Back to the top