Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] SELECT and CONCAT

It looks like functions inside of a sub select are not supported currently. 
Please log a bug for this issue.

You can use a native SQL query as a workaround, or reword the query.


Oli Tree wrote:
> 
> Hi,
> hope somebody can help me.
> I want to use a query with JPA 2.0. But it dosn't work and I don't know
> why.
> 
> The query:
> select distinct v from Partnersuche v where v.partnerIndex in (SELECT
> concat(p.pk.nebenPartnerNr, max(p.pk.paLfdAdressNr)) from PartnersucheV p
> where p.psPartnerartKey = 1 group by p.pk.nebenPartnerNr)
> 
> and here the error:
> java.lang.IllegalArgumentException: An exception occurred while creating a
> query in EntityManager:
> Exception Description: Syntax error parsing the query [select distinct v
> from Partnersuche v where v.partnerIndex in (SELECT
> concat(p.pk.nebenPartnerNr, max(p.pk.paLfdAdressNr)) from PartnersucheV p
> where p.psPartnerartKey = 1 group by p.pk.nebenPartnerNr)], line 1, column
> 71: unexpected token [concat].
> Internal Exception: NoViableAltException(16@[1292:16: ( DISTINCT )?])
> 
> 
> When I use Hibernate it works.
> 
> Thanks for help
> Oliver 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/SELECT-and-CONCAT-tp32148953p32149753.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top