|Re: [TEXO] annotations [message #902119 is a reply to message #901940]
||Thu, 16 August 2012 04:01
| Martin Taal
Registered: July 2009
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.
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
> 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.
With Regards, Martin Taal
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
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
Powered by FUDForum
. Page generated in 0.01626 seconds