Garbage SQL generated for EJBQL subqueries
------------------------------------------
Key: CAY-989
URL: https://issues.apache.org/cayenne/browse/CAY-989
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 3.0
Reporter: Andrus Adamchik
Assignee: Andrus Adamchik
Fix For: 3.0
Since EJBQL translator incorrectly reuses DISTINCT and WHERE buffers between the main query and subqueries, subqueries may end up generated incorrectly. E.g.:
"SELECT p FROM Painting p"
+ " WHERE p.estimatedPrice = ALL ("
+ " SELECT MAX(p1.estimatedPrice) FROM Painting p1"
+ ")"
SELECT t0.PAINTING_TITLE AS ec0_0, t0.ARTIST_ID AS ec0_1, t0.PAINTING_DESCRIPTION AS ec0_2, t0.ESTIMATED_PRICE AS ec0_3, t0.GALLERY_ID AS ec0_4, t0.PAINTING_ID AS ec0_5 FROM PAINTING t0 WHERE t0.ESTIMATED_PRICE = ALL (SELECT MAX(t1.ESTIMATED_PRICE) FROM PAINTING t1 WHERE)
(notice trailing WHERE...)
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
This archive was generated by hypermail 2.0.0 : Sun Feb 24 2008 - 06:52:09 EST