Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] NamedQuery annotation is not correct
[Texo] NamedQuery annotation is not correct [message #836986] Thu, 05 April 2012 05:55 Go to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Hi Author,

I found texo ORM generator doesn't process JPA NamedQuery annotation correctly.
it should be javax.persistence.NamedQueries instead of javax.persistence.NamedQuerys

After debugging into the code, I found ORMJavaAnnotationGenerator always append "s" to the collection, but it is not the case for NamedQuery

I have attached my fix in the attachment just for reference
  • Attachment: patch.diff
    (Size: 26.66KB, Downloaded 312 times)
Re: [Texo] NamedQuery annotation is not correct [message #837211 is a reply to message #836986] Thu, 05 April 2012 11:51 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
Thanks for the patch! The only thing is that I can't use the Inflector class like this because of licensing and
copyright issues :-(.

I entered a bugzilla for it:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=376169

Are you interested in providing a non-licensed submission?

gr. Martin

On 04/05/2012 07:55 AM, Oliver Zhou wrote:
> Hi Author,
>
> I found texo ORM generator doesn't process JPA NamedQuery annotation correctly.
> it should be javax.persistence.NamedQueries instead of javax.persistence.NamedQuerys
>
> After debugging into the code, I found ORMJavaAnnotationGenerator always append "s" to the collection, but it is not the case for NamedQuery
>
> I have attached my fix in the attachment just for reference


--

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] NamedQuery annotation is not correct [message #837256 is a reply to message #837211] Thu, 05 April 2012 12:56 Go to previous messageGo to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Hi Martin,

Okay, I see.
A quick search gave me another option (in central Maven repository):
<dependency>
<groupId>net.java.dev.inflector</groupId>
<artifactId>inflector</artifactId>
<version>0.7.0</version>
</dependency>
It has an Apache License, could you help to see whether it helps?
Re: [Texo] NamedQuery annotation is not correct [message #837290 is a reply to message #837256] Thu, 05 April 2012 13:30 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
In fact, most of the time it is best to have own code in Eclipse projects and only have dependencies to libraries which
are present in orbit.
http://archive.eclipse.org/tools/orbit/downloads/drops/R20090529135407/

For anything else a legal review is needed from the legal department. For larger functions this makes sense but I am
afraid that for this relatively simple/single functionality it is too much work.

So maybe it is easier for now to check/handle the specific case (ending on ry becomes ries).

gr. Martin

On 04/05/2012 02:56 PM, Oliver Zhou wrote:
> Hi Martin,
>
> Okay, I see.
> A quick search gave me another option (in central Maven repository):
> <dependency>
> <groupId>net.java.dev.inflector</groupId>
> <artifactId>inflector</artifactId>
> <version>0.7.0</version>
> </dependency>
> It has an Apache License, could you help to see whether it helps?
>


--

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] NamedQuery annotation is not correct [message #843599 is a reply to message #837290] Fri, 13 April 2012 07:27 Go to previous messageGo to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Okay, I agree with you, Martin.
A simple fix may be enough for JPA annotation.
Re: [Texo] NamedQuery annotation is not correct [message #847316 is a reply to message #843599] Tue, 17 April 2012 07:28 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
For now I chose to go for the simple fix... I published a new build. Can you check if it solves the issue?

gr. Martin

On 04/13/2012 09:28 AM, Oliver Zhou wrote:
> Okay, I agree with you, Martin.
> A simple fix may be enough for JPA annotation.


--

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] NamedQuery annotation is not correct [message #851819 is a reply to message #847316] Sat, 21 April 2012 10:48 Go to previous message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Looks great, simple enough, thanks.
Previous Topic:[Teneo] AbstractPersistentCollection crashes when Product is exported
Next Topic:edapt project status
Goto Forum:
  


Current Time: Fri Mar 29 12:27:35 GMT 2024

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

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

Back to the top