Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Dynamic mapping using XSDEcoreBuilder
[Teneo] Dynamic mapping using XSDEcoreBuilder [message #602392] Fri, 09 February 2007 03:37
Brian Vetter is currently offline Brian VetterFriend
Messages: 74
Registered: July 2009
Member
I've been trying to use XSDEcoreBuilder to generate the EPackages rather than use the generated Java implementation classes. I've run into a bunch of problems doing this and wondered if anyone else has done this successfully and has a recipe for success.

My learning experience has been that I need to make sure that the same package is not presented twice to Teneo's HbDataStore.setEPackages() method. When doing so, I ran into several null pointer exceptions. I have 3 XSDs that are imported by 3 other XSDs. When I use XSDEcoreBuilder.generate(), it returns each of the imported XSDs in addition with each call to generate on the XSDs that import them.

I'm still having a set of issues that may or be related to each other. The first is that after the mapping is complete, I tend to see 4 instances of the same table, but with "1"'s appended for each of the duplicates. This occurs for every type in the imported namespaces. For example:

ziptypes_device, ziptypes_device1, ziptypes_device11, and ziptypes_device111

I'm presuming that the problem is has to do with how the ecore packages are getting created making each of the dependent packages look like unique packages even though the namespaces and all of the underlying objects are the same.

When an instance of one of these schemas is loaded and then persisted using Teneo/hibernate, I get the following NPE. I'm presuming that it is caused by this same issue with the packages but I am unsure.

Exception in thread "main" java.lang.NullPointerException
at org.eclipse.emf.ecore.impl.EClassImpl.getFeatureID(EClassImp l.java:857)
at org.eclipse.emf.ecore.impl.DynamicEObjectImpl.eDerivedStruct uralFeatureID(DynamicEObjectImpl.java:215)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:592)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:587)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:582)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenGet(BasicEO bjectImpl.java:640)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:599)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:587)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:582)
at org.eclipse.emf.teneo.hibernate.mapping.property.EReferenceP ropertyHandler.get(EReferencePropertyHandler.java:92)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropert yValue(AbstractEntityTuplizer.java:277)
at org.hibernate.persister.entity.AbstractEntityPersister.getPr opertyValue(AbstractEntityPersister.java:3514)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBef oreSave(AbstractSaveEventListener.java:412)
at org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:261)
at org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:180)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:108)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
at org.hibernate.engine.CascadingAction$1.cascade(CascadingActi on.java:217)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBef oreSave(AbstractSaveEventListener.java:412)
at org.hibernate.event.def.AbstractSaveEventListener.performSav eOrReplicate(AbstractSaveEventListener.java:261)
at org.hibernate.event.def.AbstractSaveEventListener.performSav e(AbstractSaveEventListener.java:180)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGe neratedId(AbstractSaveEventListener.java:108)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav eWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener .java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGen eratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSave OrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535 )
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at org.ziptie.persist.cs3800Load.doLoadDoc(cs3800Load.java:122)
at org.ziptie.persist.cs3800Load.main(cs3800Load.java:47)

Any advice on how to handle dynamically loading packages and using them within Teneo are greatly appreciated. Everything thing seems to be working OK using the generated Java packages.

Brian
Previous Topic:[Announce] EMFT JET 0.7.2 M200702081115 is available
Next Topic:Re: Deadlock in WorkspaceSynchronizer
Goto Forum:
  


Current Time: Sat Oct 24 01:37:55 GMT 2020

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

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

Back to the top