openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bjorn Beskow (JIRA)" <>
Subject [jira] Created: (OPENJPA-728) SubQuery with Exists generates invalid SQL
Date Thu, 18 Sep 2008 11:11:44 GMT
SubQuery with Exists generates invalid SQL

                 Key: OPENJPA-728
             Project: OpenJPA
          Issue Type: Bug
          Components: query
    Affects Versions: 1.2.0, 1.1.0, 1.0.3, 1.0.2
         Environment: Windows XP, JDK 1.6.0_07, Derby and HSQL.
            Reporter: Bjorn Beskow
            Priority: Critical

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(,
      FROM Employee e JOIN e.address a 
      WHERE LIKE :name
      AND EXISTS (SELECT p.number from PhoneNumber p WHERE p.owner = e)

Column not found: T3.CITY in statement [SELECT, FROM Employee t0 INNER JOIN
Address t1 ON t0.address_id = WHERE ( LIKE ? ESCAPE '\' AND NOT (EXISTS (SELECT
t2.number FROM Address t1, PhoneNumber t2 WHERE (t2.owner_id =]

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message