Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » DISTINCT and ORDER BY(Bug? - EclipseLink Problem with DISTINCT and ORDER BY)
DISTINCT and ORDER BY [message #1062120] Thu, 06 June 2013 06:18 Go to next message
Oliver Baum is currently offline Oliver Baum
Messages: 6
Registered: July 2009
Junior Member
Hi,

I have a big problem with a NamedQuery. It dosn't work correct - maybe it's a bug in eclipselink.

NamedQuery:
(name = "findVertraege", query = "SELECT distinct v from VertragsSucheV v where v.partnerNr = :partnerNr order by v.pk.vertragNr, v.pk.vuCode")

Generated SQL:
SELECT DISTINCT ADRESSE, BUENDEL, GESELLSCHAFT, INVESTMENT, AMTLICHES_KENNZEICHEN, MAHNUNG, PARTNER_NR, POLICE_NR, PRODUKT, SPARTE, VERTRAGSZUSTAND, TARIF, TARIF_VIP, VERMITTLERNUMMER, VERSICHERTE_PERSON, VERTRAG_ID, VERTRAGSABLAUF, VERTRAGSROLLE_KBZ, ZUSATZVERSICHERUNG, VERTRAG_NR, VU_CODE, LFD_ROLLE_NR, VERTRAG_NR, VU_CODE FROM V_VERTRAGSUCHE WHERE (PARTNER_NR = ?) ORDER BY VERTRAG_NR ASC, VU_CODE ASC
bind => [12345678]

Exception:
ORA-00960: In der SELECT-Liste ist eine nicht eindeutige Spalte

How you can see, the Order By arguments are twice in the select statement.


If I use the NamedQuery without DISTINCT or without ORDER BY it works correct.

Can somebody please help me?


Thanks
Oliver

Re: DISTINCT and ORDER BY [message #1062197 is a reply to message #1062120] Thu, 06 June 2013 13:30 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris Delahunt
Messages: 1034
Registered: July 2009
Senior Member
This looks like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=346729 which is marked as fixed in EclipseLink 2.4. Please try a later version with the fix and file a bug with a test case if it still occurs.

Best Regards,
Chris
Re: DISTINCT and ORDER BY [message #1062214 is a reply to message #1062197] Thu, 06 June 2013 14:23 Go to previous message
Oliver Baum is currently offline Oliver Baum
Messages: 6
Registered: July 2009
Junior Member
Hello Chris,

Thanks for the information

I use EclipseLink 2.4 and the error still occurs. I use a Oracle 11 g Database.


I will open an new bug.


Regards
Oliver
Previous Topic:Eclipse Data Partition Question
Next Topic:OnetoOne mapping issue
Goto Forum:
  


Current Time: Sat Oct 25 12:09:25 GMT 2014

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

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