[solved][Teneo] Persistence mapping builder looking for everything [message #1720440] |
Mon, 18 January 2016 16:16 |
Pierre Villard Messages: 9 Registered: July 2013 |
Junior Member |
|
|
Hi,
I am quite new using Teneo and I am facing an issue with my model.
Version of EMF Ecore : 2.11.1
Version of Teneo : 2.1.0
Version of Hibernate : 4.3.11
I have a model based on quite complex XSD files that I can't modify. The generation of the model is fine.
I am trying to test Teneo with a persistence file that is only referencing one class :
<persistence-mapping>
<epackage namespace-uri="http://a/b/c/">
<eclass name="MyObject">
<entity />
</eclass>
</epackage>
</persistence-mapping>
The class MyObject is only referencing simple types.
So I would expect that the Teneo mapping is working fine as is.
However, as far as I understand what is going on, the mapping builder is looking for dependencies of the EPackage containing MyObject (and there is a lot of EPackage dependencies).
To get things going further I need to register with Teneo the other EPackages. Is it mandatory ? Or is there a way to only look for what is needed according to my persistence file ?
If I don't register the other EPackages, I get the following error :
Caused by: java.lang.IllegalArgumentException: No annotated model element present for: Foo for type EClass has its epackage been registered with Teneo?
at org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedModelImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:347) ~[org.eclipse.emf.teneo.annotations-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedModelImpl.getPAnnotated(PAnnotatedModelImpl.java:287) ~[org.eclipse.emf.teneo.annotations-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedEReferenceImpl.getAReferenceType(PAnnotatedEReferenceImpl.java:227) ~[org.eclipse.emf.teneo.annotations-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.EFeatureAnnotator.annotate(EFeatureAnnotator.java:111) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator.annotate(EClassAnnotator.java:307) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.annotations.HbEClassAnnotator.annotate(HbEClassAnnotator.java:56) ~[org.eclipse.emf.teneo.hibernate.mapper-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator.processPackage(AnnotationGenerator.java:183) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator.map(AnnotationGenerator.java:146) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder.buildMapping(PersistenceMappingBuilder.java:215) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbDataStore.java:1070) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore.mapModel(HbEntityDataStore.java:241) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore.initialize(HbEntityDataStore.java:116) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
If it is mandatory, my other problem is that, in my model, some objects have attributes of type "AnyType" and it seems to be a problem with Teneo. It makes sense that this is a problem because I don't see how it would be possible to handle "AnyType" objects in a database.
If I add all the required EPackages, I get the following error :
Caused by: java.lang.IllegalArgumentException: No annotated model element present for: AnyType for type EClass has its epackage been registered with Teneo?
at org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedModelImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:347) ~[org.eclipse.emf.teneo.annotations-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedModelImpl.getPAnnotated(PAnnotatedModelImpl.java:287) ~[org.eclipse.emf.teneo.annotations-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator.annotate(EClassAnnotator.java:96) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.annotations.HbEClassAnnotator.annotate(HbEClassAnnotator.java:56) ~[org.eclipse.emf.teneo.hibernate.mapper-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator.processPackage(AnnotationGenerator.java:183) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator.map(AnnotationGenerator.java:146) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder.buildMapping(PersistenceMappingBuilder.java:215) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbDataStore.java:1070) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore.mapModel(HbEntityDataStore.java:241) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore.initialize(HbEntityDataStore.java:116) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
So I tried to add the following EPackage :
org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImpl
But in this case, I get the following error :
Caused by: java.lang.NullPointerException: null
at org.eclipse.emf.teneo.annotations.mapper.ManyToOneReferenceAnnotator.annotate(ManyToOneReferenceAnnotator.java:105) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.annotations.HbManyToOneReferenceAnnotator.annotate(HbManyToOneReferenceAnnotator.java:48) ~[org.eclipse.emf.teneo.hibernate.mapper-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.EFeatureAnnotator.annotate(EFeatureAnnotator.java:236) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator.annotate(EClassAnnotator.java:307) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.annotations.HbEClassAnnotator.annotate(HbEClassAnnotator.java:56) ~[org.eclipse.emf.teneo.hibernate.mapper-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator.processPackage(AnnotationGenerator.java:183) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator.map(AnnotationGenerator.java:146) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder.buildMapping(PersistenceMappingBuilder.java:215) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbDataStore.java:1070) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore.mapModel(HbEntityDataStore.java:241) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore.initialize(HbEntityDataStore.java:116) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
Am I missing something ?
EDIT :
Well.. I tried to remove all the AnyType declaration and the reference to the generic package (org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImpl) and I still get the last error I reported in my previous post :
Caused by: java.lang.NullPointerException: null
at org.eclipse.emf.teneo.annotations.mapper.ManyToOneReferenceAnnotator.annotate(ManyToOneReferenceAnnotator.java:105) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.annotations.HbManyToOneReferenceAnnotator.annotate(HbManyToOneReferenceAnnotator.java:48) ~[org.eclipse.emf.teneo.hibernate.mapper-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.EFeatureAnnotator.annotate(EFeatureAnnotator.java:236) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator.annotate(EClassAnnotator.java:307) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.annotations.HbEClassAnnotator.annotate(HbEClassAnnotator.java:56) ~[org.eclipse.emf.teneo.hibernate.mapper-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator.processPackage(AnnotationGenerator.java:183) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator.map(AnnotationGenerator.java:146) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder.buildMapping(PersistenceMappingBuilder.java:215) ~[org.eclipse.emf.teneo-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbDataStore.java:1070) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore.mapModel(HbEntityDataStore.java:241) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore.initialize(HbEntityDataStore.java:116) ~[org.eclipse.emf.teneo.hibernate-2.1.0-v201501071531.jar:na]
Any idea how to debug this issue ?
Thanks a lot for your help !
[Updated on: Tue, 19 January 2016 08:43] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03698 seconds