Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to generate an additional Factory class
How to generate an additional Factory class [message #768182] Mon, 19 December 2011 17:51 Go to next message
Eclipse UserFriend
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 #768191 is a reply to message #768182] Mon, 19 December 2011 18:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
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/
Re: How to generate an additional Factory class [message #768201 is a reply to message #768191] Mon, 19 December 2011 18:46 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Previous Topic:TEXO - ModelEMFConverter - IllegalStateException
Next Topic:[EMF] convertion from pojo to EMF eObject
Goto Forum:
  


Current Time: Fri Sep 20 10:58:10 GMT 2024

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

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

Back to the top