[Teneo] Persisting an Ecore Model [message #606776] |
Thu, 24 May 2007 06:19 |
Ian Bull Messages: 145 Registered: July 2009 |
Senior Member |
|
|
I have been trying to persist a bunch of data (each to its own database)
and the corresponding Ecore model to which each of the datasets conforms
(each Ecore model would be persisted to its own database). At some
point in the future I plan on loading one of the datasets, but before I
can load the dataset, I need to load the ecore model. So the algorithm
is basically:
determine what dataset I need
create a hbds with EcorePackage and XMLTypePackage as the ePackages
do query("from ecore_EObject as EObject where dtype='EPackage'");
create a hbds with the result of the query as the ePackage
query the new hbds on the instance data
However, when I loaded the ePACKAGE I received a number of errors
because it seems that the eTypes are not persisted. In order to get
this to work, I had to add the following lines when I persisted the
models, and again, when I load them back:
EcorePackage.eINSTANCE.getETypedElement().getEStructuralFeat ure(EcorePackage.ETYPED_ELEMENT__ETYPE).setVolatile(false);
EcorePackage.eINSTANCE.getEClass().getEStructuralFeature(Eco rePackage.ECLASS__INSTANCE_CLASS_NAME).setVolatile(false);
I am posting this here in case others have similar problems.
Martin, Ed, does this make sense to you guys?
cheers,
ian
|
|
|
Powered by
FUDForum. Page generated in 0.02661 seconds