|
Re: [Teneo] Use several ecore file for the same model [message #128885 is a reply to message #128858] |
Fri, 22 August 2008 16:26 |
Martin Taal 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 |
Martin Taal 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
|
|
|
Powered by
FUDForum. Page generated in 0.02796 seconds