Community
Participate
Working Groups
Build Identifier: 2.2.0 The joined jpql query is not properly translated in TSQL (the Microsoft version for SQL Server of the SQL language). When the TSQL query is executed, the database server says : "Syntaxe incorrecte vers le mot clé 'IN'" (french version). In english it would be something like "Incorrect syntax near token 'IN'" Both (JPQL and SQL generated) queries are joined to the issue. The problem is that there is nothing before the 'IN' keyword in the query. It seems that a variable is not resolved when JPQL is translated. Used EclipseLink is 2.2.0 FOR JPA 2.0.3 on Glassfish 3.1. The version of SQL Server is 2008 R2. Any idea or workaround ? Reproducible: Always
Created attachment 210146 [details] The JPQL query
Created attachment 210147 [details] The TSQL query
The only exception i have is when database server indicate that the query is syntaxically incorrect. There is no exception from Eclipselink at translation.
The documentation says that i was trying to do is not possible. In my JPQL, i check if an object (let say x) is returned from a subquery. I write it like this : WHERE x IN (SELECT y FROM ...) The documentation for the IN keyword in JPQL language reference (http://docs.oracle.com/cd/E11035_01/kodo41/full/html/ejb3_langref.html#ejb3_langref_in) says that IN keywork can test attributes only. That's why translation doesn't work. However, Eclipselink should throw an exception when parsing this...
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
I think this has been fixed in 2.4, please try on the latest nightly build.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink