Community
Participate
Working Groups
Build ID: 1.0 Steps To Reproduce: I have a JPQL query that looks like this: select sol from Sellorderline sol where sol.iArticle in (select a from License l inner join l.iLicenseArticlesWhereIAmLicense la inner join la.iArticle a where l = :license) The generated SQL looks like this (I've stripped some of the returned fields): SELECT t1.sellorderlinenr, t1.articlenr, ...,t1.dwhby FROM article t0, sellorderline t1 WHERE ( IN (SELECT DISTINCT t2.articlenr, t2.articletypenr, ..., t2.salestatus FROM license t4, license_article t3, article t2 WHERE ((? = t4.licensenr) AND ((t3.licensenr = t4.licensenr) AND (t2.articlenr = t3.articlenr)))) AND (t0.articlenr = t1.articlenr)) Note the "WHERE ( IN (SELECT"; the left side of the IN is not present. It turns out you cannot do a entity-in-entity, you need to do attribute-in-attribute. The huge list of fields that the subquery returned is the clue. not: ... and sol.iArticle in (select a ... but: ... and sol.iArticle.iArticlenr in (select a.iArticlenr ... Maybe an error message would be appropriate or supporting this JPQL syntax (although when the entity has non-single-attribute keys, that cannot be done). More information:
Fixed this, it now works, so no error message required.
See, Bug#314025
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink