Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 60970 invoked from network); 23 Sep 2008 12:07:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Sep 2008 12:07:05 -0000 Received: (qmail 7789 invoked by uid 500); 23 Sep 2008 12:07:02 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 7767 invoked by uid 500); 23 Sep 2008 12:07:02 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 7756 invoked by uid 99); 23 Sep 2008 12:07:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 05:07:02 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 12:06:10 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 30D5F234C1DF for ; Tue, 23 Sep 2008 05:06:44 -0700 (PDT) Message-ID: <1266493210.1222171604186.JavaMail.jira@brutus> Date: Tue, 23 Sep 2008 05:06:44 -0700 (PDT) From: "Bjorn Beskow (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-728) SubQuery with Exists generates invalid SQL In-Reply-To: <2057779698.1221736304410.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bjorn Beskow updated OPENJPA-728: --------------------------------- Attachment: openjpa-bug.zip Fixed testcase with inverse relationship, to show that SQL generation problem still remains. > SubQuery with Exists generates invalid SQL > ------------------------------------------ > > Key: OPENJPA-728 > URL: https://issues.apache.org/jira/browse/OPENJPA-728 > Project: OpenJPA > Issue Type: Bug > Components: query > Affects Versions: 1.0.2, 1.0.3, 1.1.0, 1.2.0 > Environment: Windows XP, JDK 1.6.0_07, Derby and HSQL. > Reporter: Bjorn Beskow > Assignee: Michael Dick > Priority: Critical > Attachments: openjpa-bug.zip, openjpa-bug.zip > > > When using a subquery containing EXISTS, the generated SQL contains table aliases that does not exist in the select statement. For example, the following query: > SELECT new test.dto.EmployeeReportDTO(e.name, a.city) > FROM Employee e JOIN e.address a > WHERE e.name LIKE :name > AND EXISTS (SELECT p.number from PhoneNumber p WHERE p.owner = e) > Column not found: T3.CITY in statement [SELECT t0.name, t3.city FROM Employee t0 INNER JOIN Address t1 ON t0.address_id = t1.id WHERE (t0.name LIKE ? ESCAPE '\' AND NOT (EXISTS (SELECT t2.number FROM Address t1, PhoneNumber t2 WHERE (t2.owner_id = t0.id))))] -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.