Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [FIXED][Texo] ORM Annotation -> Basic -> Enumerated : wrong JPA generation result(error in generated code)
[FIXED][Texo] ORM Annotation -> Basic -> Enumerated : wrong JPA generation result [message #784337] Fri, 27 January 2012 11:25 Go to next message
Benoit Cantin is currently offline Benoit CantinFriend
Messages: 34
Registered: January 2012
Member
Hello all,

First of all, thanks for the great tool that is Texo.

My problem is that JPA code generation result in a compile error.

The use case is the following. In my .ecore, I have created an EEnum called YY, and an EClass called XX, having an EAttribute ZZ of type YY.

My purpose is to generate the JPA annotated model code so that the attribute ZZ in class XX is annotated @Enumerated(EnumType.STRING).

To do that I have created a .annotationsmodel with an Annotated EClass XX, with inside an Annotated EAttribute ZZ and inside a child Basic. In this 'Basic', I set the property Enumerated to String.

The code generated is almost correct :
@Enumerated(EnumeratedType.STRING)

Except that EnumeratedType does not exists in the JPA 2 spec. It should be instead EnumType.

Is there something I'am missing ?

[Updated on: Mon, 13 February 2012 12:38]

Report message to a moderator

Re: [Texo] ORM Annotation -> Basic -> Enumerated : wrong JPA generation result [message #784442 is a reply to message #784337] Fri, 27 January 2012 14:35 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Benoit,
This seems to be a bug, can you enter a bugzilla with the ecore attached? Then I will solve it shortly.

gr. Martin

On 01/27/2012 12:25 PM, Benoit Cantin wrote:
> Hello all,
>
> First of all, thanks for the great tool that is Texo.
>
> My problem is that JPA code generation result in a compile error.
>
> The use case is the following. In my .ecore, I have created an EEnum called YY, and an EClass called XX, having an
> EAttribute ZZ of type YY.
>
> My purpose is to generate the JPA annotated model code so that the attribute ZZ in class XX is annotated
> @Enumerated(EnumType.STRING).
>
> To do that I have created a .annotationsmodel with an Annotated EClass XX, with inside an Annotated EAttribute ZZ and
> inside a child Basic. In this 'Basic', I set the property Enumerated to String.
>
> The code generated is almost correct :
> @Enumerated(EnumeratedType.STRING)
>
> Except that EnumeratedType does not exists in the JPA 2 spec. It should be instead EnumType.
>
> Is there something I'am missing ?
>


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Texo] ORM Annotation -> Basic -> Enumerated : wrong JPA generation result [message #784456 is a reply to message #784442] Fri, 27 January 2012 15:02 Go to previous messageGo to next message
Benoit Cantin is currently offline Benoit CantinFriend
Messages: 34
Registered: January 2012
Member
Thanks for the quick answer.


Bug created : id=369931
with the use case attached.

(sorry for this : I can't post the whole URL since I've posted less than 5 messages).
Re: [Texo] ORM Annotation -> Basic -> Enumerated : wrong JPA generation result [message #786298 is a reply to message #784456] Mon, 30 January 2012 08:38 Go to previous messageGo to next message
Benoit Cantin is currently offline Benoit CantinFriend
Messages: 34
Registered: January 2012
Member
I hava also created bug N° 369962. This is a similar problem of JPA generation, but concerning Inheritance mode.
Re: [Texo] ORM Annotation -> Basic -> Enumerated : wrong JPA generation result [message #797396 is a reply to message #786298] Mon, 13 February 2012 12:37 Go to previous message
Benoit Cantin is currently offline Benoit CantinFriend
Messages: 34
Registered: January 2012
Member
I've just tested. Both bugs are effectively fixed now. Thanks.
Previous Topic:[FIXED][Texo] Enforce on which side of a one-to-one relation the 'mapped-by' attribute is generated
Next Topic:[Texo] Best way to add JPA implementor specific annotation to generated entities
Goto Forum:
  


Current Time: Fri Apr 19 06:26:47 GMT 2024

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

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

Back to the top