Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Model api generation generates an ecore model again ?
Model api generation generates an ecore model again ? [message #414429] Tue, 06 November 2007 15:39 Go to next message
Stephane  fournier is currently offline Stephane fournierFriend
Messages: 340
Registered: July 2009
Senior Member
Hi,

I have got a weird behavior when generating the model API for one of my
EMF models (this model was originally created from annotated java code and
is copied in another project where the generation is really done, I don't
know if it is relevant).
Indeed, I got a new ecore model among my model element implementation
classes named "model.ecore". Weird isn't it ?

I tried to debug the model generation, and I found that the ecore file is
created by GenPackageGeneratorAdapter#generatePackageSerialization method.
In this method, the local variable targetPathName (at line 249) is set to
my implementation java package and the file is serialized on disk at line
338.

Does anyone have an idea of what it is happening there ?

Stephane.
Re: Model api generation generates an ecore model again ? [message #414430 is a reply to message #414429] Tue, 06 November 2007 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Stephane,

It looks like your EPackage implementation is generated to initialize its
metadata from the .ecore file. Hence, this file is deployed into the Java
package.

This would be either because your GenModel has the option to "initialize by
loading" enabled, or because the code generator detected that your EPackage
has too many elements to generate the static initialization (owing to the
size of the initialization method being to large for javac to compile).

HTH,

Christian

Stephane wrote:

> Hi,
>
> I have got a weird behavior when generating the model API for one of my
> EMF models (this model was originally created from annotated java code and
> is copied in another project where the generation is really done, I don't
> know if it is relevant).
> Indeed, I got a new ecore model among my model element implementation
> classes named "model.ecore". Weird isn't it ?
>
> I tried to debug the model generation, and I found that the ecore file is
> created by GenPackageGeneratorAdapter#generatePackageSerialization method.
> In this method, the local variable targetPathName (at line 249) is set to
> my implementation java package and the file is serialized on disk at line
> 338.
>
> Does anyone have an idea of what it is happening there ?
>
> Stephane.
Re: Model api generation generates an ecore model again ? [message #414431 is a reply to message #414430] Tue, 06 November 2007 16:52 Go to previous message
Stephane  fournier is currently offline Stephane fournierFriend
Messages: 340
Registered: July 2009
Senior Member
Hi, Christian,
You're quite right !

My GenModel has the option "initialize by loading" enabled and the
EPackage has many elements.

Stephane.


Christian W. Damus wrote:

> Hi, Stephane,

> It looks like your EPackage implementation is generated to initialize its
> metadata from the .ecore file. Hence, this file is deployed into the Java
> package.

> This would be either because your GenModel has the option to "initialize by
> loading" enabled, or because the code generator detected that your EPackage
> has too many elements to generate the static initialization (owing to the
> size of the initialization method being to large for javac to compile).

> HTH,

> Christian

> Stephane wrote:

>> Hi,
>>
>> I have got a weird behavior when generating the model API for one of my
>> EMF models (this model was originally created from annotated java code and
>> is copied in another project where the generation is really done, I don't
>> know if it is relevant).
>> Indeed, I got a new ecore model among my model element implementation
>> classes named "model.ecore". Weird isn't it ?
>>
>> I tried to debug the model generation, and I found that the ecore file is
>> created by GenPackageGeneratorAdapter#generatePackageSerialization method.
>> In this method, the local variable targetPathName (at line 249) is set to
>> my implementation java package and the file is serialized on disk at line
>> 338.
>>
>> Does anyone have an idea of what it is happening there ?
>>
>> Stephane.
Previous Topic:Referencing attribute of target class in message of OCL Constraint
Next Topic:Is there a way to implement EMF derived properties by OCL, when use dynamic model?
Goto Forum:
  


Current Time: Thu Apr 25 23:03:50 GMT 2024

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

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

Back to the top