How to generate an additional Factory class [message #768182] |
Mon, 19 December 2011 17:51 |
Eclipse User |
|
|
|
I need to generate an additional Factory class. The template uses JPA
annotations added to the ecore model.
I subclasses GenPackageGeneratorAdapter and overrode generateModel to
call only generateFactoryInterface and generateFactoryClass (also
overridden).
I'm testing with a very simplified template based on the standard
GenFactoryClass template.
1) Is this generally the correct approach?
2) I'm getting no errors but also no new output to the file system (or
differences to existing generated code).
ANY pointers greatly appreciated!
Thanks
Roy
|
|
|
|
Re: How to generate an additional Factory class [message #768201 is a reply to message #768191] |
Mon, 19 December 2011 18:46 |
Eclipse User |
|
|
|
Thanks Ed,
I forgot to say that I am using the generator extension. Rather than
write a new template from scratch though I started from the standard
Factory gen template.
Roy
On 12/19/2011 10:11 AM, Ed Merks wrote:
> Roy,
>
> Comments below.
>
> On 19/12/2011 6:51 PM, Roy Benjamin wrote:
>>
>> I need to generate an additional Factory class. The template uses JPA
>> annotations added to the ecore model.
>>
>> I subclasses GenPackageGeneratorAdapter and overrode generateModel to
>> call only generateFactoryInterface and generateFactoryClass (also
>> overridden).
>>
>> I'm testing with a very simplified template based on the standard
>> GenFactoryClass template.
>>
>>
>> 1) Is this generally the correct approach?
> If you want additional things, you could do that using a generator
> extension rather than modifying what's generated normally.
>>
>> 2) I'm getting no errors but also no new output to the file system (or
>> differences to existing generated code).
>>
>> ANY pointers greatly appreciated!
> Have a look at the generator extension example for generating additional
> artifacts; you can install it from the examples into your workspace.
>>
>> Thanks
>>
>> Roy
|
|
|
Re: How to generate an additional Factory class [message #768207 is a reply to message #768201] |
Mon, 19 December 2011 18:55 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Ron,
I can only suggest you run under debug control and see whether your
stuff is being called and whether it's throwing an exception or
something like that...
On 19/12/2011 7:46 PM, Roy Benjamin wrote:
>
> Thanks Ed,
>
> I forgot to say that I am using the generator extension. Rather than
> write a new template from scratch though I started from the standard
> Factory gen template.
>
> Roy
>
> On 12/19/2011 10:11 AM, Ed Merks wrote:
>> Roy,
>>
>> Comments below.
>>
>> On 19/12/2011 6:51 PM, Roy Benjamin wrote:
>>>
>>> I need to generate an additional Factory class. The template uses JPA
>>> annotations added to the ecore model.
>>>
>>> I subclasses GenPackageGeneratorAdapter and overrode generateModel to
>>> call only generateFactoryInterface and generateFactoryClass (also
>>> overridden).
>>>
>>> I'm testing with a very simplified template based on the standard
>>> GenFactoryClass template.
>>>
>>>
>>> 1) Is this generally the correct approach?
>> If you want additional things, you could do that using a generator
>> extension rather than modifying what's generated normally.
>>>
>>> 2) I'm getting no errors but also no new output to the file system (or
>>> differences to existing generated code).
>>>
>>> ANY pointers greatly appreciated!
>> Have a look at the generator extension example for generating additional
>> artifacts; you can install it from the examples into your workspace.
>>>
>>> Thanks
>>>
>>> Roy
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03445 seconds