Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] annotations
[TEXO] annotations [message #901770] Tue, 14 August 2012 13:57 Go to next message
Gary Godfrey is currently offline Gary Godfrey
Messages: 31
Registered: February 2012
Member
Hi Martin,

Is there a way to have both ORM and code-gen annotations when I generate the code please?

Regards,
Gary
Re: [TEXO] annotations [message #901802 is a reply to message #901770] Tue, 14 August 2012 15:52 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5334
Registered: July 2009
Senior Member
Hi Gary,
What do you mean with code-gen annotations?

gr. Martin

On 08/14/2012 03:57 PM, Gary Godfrey wrote:
> Hi Martin,
>
> Is there a way to have both ORM and code-gen annotations when I generate the code please?
>
> Regards,
> Gary


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [TEXO] annotations [message #901940 is a reply to message #901802] Wed, 15 August 2012 08:26 Go to previous messageGo to next message
Gary Godfrey is currently offline Gary Godfrey
Messages: 31
Registered: February 2012
Member
Hi Martin,

The current process I follow after generating .ecore file.

1. Generate code gen annotated model. I add a value for root class extends and also mark some entities as transient. File is called xsdmodelname-code-gen.annotationsmodel

2. Generate ORM annotations model. Set 'enforce unique names' to false, set max table name to 30. File is called xsdmodelname-orm.annotationsmodel

I remember in an earlier version I needed to rename the file as xsdmodelname.annotationsmodel for the 'Generate JPA Annotated Code' step to pick up my changes. I have tried merging the changes I have made into a single annotationsmodel but this fails as I have 2 <ePackageAnnotations xsi:type .... and generation fails.

Ideally we want to be able to apply both types of updates during code generation.

Regards,
Gary
Re: [TEXO] annotations [message #902119 is a reply to message #901940] Thu, 16 August 2012 04:01 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5334
Registered: July 2009
Senior Member
Hi Gary,
The best is to start with an empty annotations model, with only the epackage level annotations for example. Then you can
manually add both codegen and orm annotations in one model (right click on a model element and you will see both
possibilities), only for the eclasses/ereferences you want to override.

With such a minimal annotations model the options also still work for most types (the annotations in the
annotationsmodel override the options).

The idea is that you should only annotate what you want to override, this should ideally only be minimal. If you need a
lot of annotations to accomplish something then let me know, as this is better covered through an option or so.

gr. Martin

On 08/15/2012 10:26 AM, Gary Godfrey wrote:
> Hi Martin,
>
> The current process I follow after generating .ecore file.
>
> 1. Generate code gen annotated model. I add a value for root class extends and also mark some entities as transient.
> File is called xsdmodelname-code-gen.annotationsmodel
>
> 2. Generate ORM annotations model. Set 'enforce unique names' to false, set max table name to 30. File is called
> xsdmodelname-orm.annotationsmodel
>
> I remember in an earlier version I needed to rename the file as xsdmodelname.annotationsmodel for the 'Generate JPA
> Annotated Code' step to pick up my changes. I have tried merging the changes I have made into a single annotationsmodel
> but this fails as I have 2 <ePackageAnnotations xsi:type .... and generation fails.
>
> Ideally we want to be able to apply both types of updates during code generation.
>
> Regards,
> Gary


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:[TEXO] JPA entity names
Next Topic:[Texo] Complete tutorial (from scratch)
Goto Forum:
  


Current Time: Tue Sep 23 14:39:25 GMT 2014

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

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