Issue Details (XML | Word | Printable)

Key: HHH-2609
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Michael Barker
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hibernate Core

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

Created: 12/May/07 11:40 AM   Updated: 27/Apr/08 11:35 PM
Component/s: query-hql
Affects Version/s: 3.2.4
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive delete-ejbql-problem.zip (3 kB)

Environment: Linux, JDK 1.5.
Issue Links:
Relates
 


 Description  « Hide
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.

 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.