Home » Modeling » EMF » Generate Java annotations from EAnnotation's(Generate custom java annotations in generated code)
Generate Java annotations from EAnnotation's [message #1697042] |
Mon, 01 June 2015 07:27 |
Gordan Vosicki Messages: 13 Registered: March 2013 |
Junior Member |
|
|
It is of course possible to generate an ECore model from annotated Java.
But is there a standats EAnnotation which would cause a Java annotation to be generated in the generated code (like "body" to generate the source code of a method, but before the method declaration) ?
This annotation would apply to class, attribute, reference and operation.
I would need it because some of my ecore models are generated from another source and it would be an elegant way to pass additional informations to runtime (UI, DB).
It could also be useful regarding the Java validation API (JSR-303).
It would probably not be difficult, but I'm not exactly fluent with templates ...
[Updated on: Mon, 01 June 2015 11:11] Report message to a moderator
|
|
| | | | | |
Re: Generate Java annotations from EAnnotation's [message #1697182 is a reply to message #1697171] |
Tue, 02 June 2015 08:12 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
The "e" features are also there in Texo:
https://wiki.eclipse.org/Texo/Runtime_Model#Model-driven_access_to_Pojo.27s
But JDO is not there in Texo for sure.
gr. Martin
On 02-06-15 09:25, Gordan Vosicki wrote:
> The same feature for Java annotations in standard EMF generation would be great ...
> Actually, at some point, I need the "e" feratures (like eClass()), so Texo does not work for all cases.
>
> Also, JPA is limited to relational databases.
> Actually, a great thing would be to have direct JDO generation, actually having a JDO StateManager using the EMF
> introspection features, without the need for "enhancement" ... but that's another chapter !
--
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: Generate Java annotations from EAnnotation's [message #1698548 is a reply to message #1698540] |
Tue, 16 June 2015 11:13 |
Gordan Vosicki Messages: 13 Registered: March 2013 |
Junior Member |
|
|
Martin, I definitely need JDO support because some use cases involve a non-SQL datastore (ex. a CAD drawing !).
After a quick look, one of the best solutions would be to add JDO generation in Texo as a variant of JPA.
The data classes could be generated already "source-enhanced" and many annotations are quite similar, as well as the O/R mapping variant for JDO.
If we decide to go this way, would you be interested in having this JDO feature incorporated in Texo, and would you be ready to eventually give a few tips/advice for project layout and organisation and maybe a few technical questions and then have these new features integrated in the Texo project ?
It's a pity that those two great products (EMF/ECore and JDO) don't yet talk together !
[Updated on: Tue, 16 June 2015 11:22] Report message to a moderator
|
|
|
Re: Generate Java annotations from EAnnotation's [message #1698644 is a reply to message #1698548] |
Tue, 16 June 2015 22:08 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Gordan,
Yes quite interesting!
For the forum/newsgroup followup/archive, we will continue the discussion directly through email on this topic.
gr. Martin
On 16-06-15 13:13, Gordan Vosicki wrote:
> Martin, I definitely need JDO support because some use cases involve a non-SQL datastore (ex. a CAD drawing !).
> After a quick look, one of the best solutions would be to add JDO generation in Texo as a variant of JPA.
>
> The data classes could be generated already "source-enhanced" and many annotations are quite similar, as well as the O/R
> mapping variant of JDO.
> If we decide to go this way, would you be interested in having this JDO feature incorporated in Texo, and would you be
> ready to eventually give a few tips/advice for project layout and organisation and maybe a few technical questions and
> then have these new features integrated in the Texo project ?
>
>
--
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
|
|
|
Goto Forum:
Current Time: Tue Sep 24 13:09:53 GMT 2024
Powered by FUDForum. Page generated in 0.05176 seconds
|