|
Re: Referencing another ecore model with package name changed [message #518737 is a reply to message #518735] |
Thu, 04 March 2010 20:41 |
Ed Merks Messages: 33145 Registered: July 2009 |
Senior Member |
|
|
Phil,
Comments below.
Phillipus wrote:
> Hi,
>
> I have simplified the following scenario to make it easier to explain...
>
> I have an ECore model, "mymodel.ecore", contains one package,
> "mypackage".
> In that package is an EClass, "MyClass".
> In the .genmodel for the model I declare the base package to be
> "com.somewhere".
> Thus, the generated code resides in packages
> "com.somewhere.mypackage" and "com.somewhere.mypackage.impl".
>
> I have another ECore model, "another.ecore" wherein an EClass has a
> EReference to the "MyClass" from "mymodel.ecore".
> So I Load the "mymodel.ecore" Resource into the ECore editor and
> reference it.
> Fine.
>
> However...when I generate the code for "another.ecore" from
> "another.genmodel" the package name for "MyClass" is
> "mypackage.MyClass" not "com.somewhere.mypackage.MyClass" and an error
> results.
>
> Am I missing something?
Probably. When you created the GenModel for another.ecore, on the last
page of the wizard, did you locate the GenModel for mymodel.ecore and
select to reuse the GenPackage that already exists for mymodel.ecore
within that first GenModel? If not, you'll end up generating another
copy of that whole model and none of the settings you had before will be
there.
>
> (And many thanks for a wonderful modelling framework! :-) )
>
> Phil
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Referencing another ecore model with package name changed [message #518741 is a reply to message #518737] |
Thu, 04 March 2010 16:08 |
h1055071 Messages: 335 Registered: July 2009 |
Senior Member |
|
|
On 04/03/2010 20:41, Ed Merks wrote:
> Phil,
>
> Comments below.
>
> Phillipus wrote:
>> Hi,
>>
>> I have simplified the following scenario to make it easier to explain...
>>
>> I have an ECore model, "mymodel.ecore", contains one package,
>> "mypackage".
>> In that package is an EClass, "MyClass".
>> In the .genmodel for the model I declare the base package to be
>> "com.somewhere".
>> Thus, the generated code resides in packages
>> "com.somewhere.mypackage" and "com.somewhere.mypackage.impl".
>>
>> I have another ECore model, "another.ecore" wherein an EClass has a
>> EReference to the "MyClass" from "mymodel.ecore".
>> So I Load the "mymodel.ecore" Resource into the ECore editor and
>> reference it.
>> Fine.
>>
>> However...when I generate the code for "another.ecore" from
>> "another.genmodel" the package name for "MyClass" is
>> "mypackage.MyClass" not "com.somewhere.mypackage.MyClass" and an error
>> results.
>>
>> Am I missing something?
> Probably. When you created the GenModel for another.ecore, on the last
> page of the wizard, did you locate the GenModel for mymodel.ecore and
> select to reuse the GenPackage that already exists for mymodel.ecore
> within that first GenModel? If not, you'll end up generating another
> copy of that whole model and none of the settings you had before will be
> there.
>>
>> (And many thanks for a wonderful modelling framework! :-) )
>>
>> Phil
Ed, thanks again for the fast response...
Yep, that was it. You nailed it! God, this EMF stuff is good!
Phil
|
|
|
Powered by
FUDForum. Page generated in 0.03214 seconds