[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2609) Delete with multiple nested sub-queries generates invalid SQL (on Postgresql)

Michael Barker (JIRA) noreply at atlassian.com
Sat May 12 12:41:04 EDT 2007


Delete with multiple nested sub-queries generates invalid SQL (on Postgresql)
-----------------------------------------------------------------------------

                 Key: HHH-2609
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2609
             Project: Hibernate3
          Issue Type: Bug
          Components: query-hql
    Affects Versions: 3.2.4
         Environment: Linux, JDK 1.5.
            Reporter: Michael Barker
         Attachments: delete-ejbql-problem.zip

When a delete uses multiple nest subqueries the resulting SQL query generated is invalid.  E.g. the EJB-QL:

DELETE Foo f WHERE f.fooId NOT IN (SELECT bar.fooId FROM Bar bar) AND f.fooId NOT IN (SELECT baz.fooId FROM Baz baz)
or 
DELETE Foo WHERE fooId NOT IN (SELECT fooId FROM Bar) AND fooId NOT IN (SELECT fooId FROM Baz)

Generates the following:

delete from Foo where (fooId not in  (select bar1_.fooId from Bar bar1_)) and (foo0_.fooId not in  (select baz2_.fooId from Baz baz2_))

Will fail because the field "foo0_.fooId" should be "fooId", "foo0_" is not declared.

At test case is attached.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list