[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: generated ecore file in impl directory

Hi Will,

This slightly modified version of your Ecore model will be loaded to provide your metadata at runtime, so if it's being generated, you shouldn't delete it.

It's there as an alternative to the initialization code that would otherwise be generated in XYZPackageImpl. The reason is that, for big models, that initialization code can include methods that exceed the maximum allowed size in Java.

There is a GenModel property that controls whether to use the standard initialization pattern or the loading pattern. EMF attempts to guess whether your model is "big" and, if so, sets the property to use the loading pattern. However, this guess is often not terribly accurate, and you may be able to get away with switching it back.

Select a package and look under "Model" for "Initialize by Loading". Set it to false and try regenerating the code. If it compiles, you should be fine, and can delete the b.ecore file.

Cheers,
Dave


Will Horn wrote:
I split out some of my model (schema based) into two separate models/packages: a base model A and another model B that references A. Everything seems to work as expected except that in the impl directory for model B, I am now getting a generated ecore file. It seems to be the same as my b.ecore, except that for types defined in A it uses the namespace instead of a relative path. For example it will have

<eStructuralFeatures xsi:type="ecore:EAttribute" name="note" eType="ecore:EDataType http://www.example.com/a#//Text1024";>

whereas b.ecore would just have

<eStructuralFeatures xsi:type="ecore:EAttribute" name="note" eType="ecore:EDataType ../../com.example.a/model/a.ecore#//Text1024">

It's not a big deal, but I am wondering what the purpose of this generated ecore file is. If I delete it, is is still regenerated. Is it because of some genmodel setting I have inadvertently triggered?

Thanks,
Will