Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

JPQL2 : Processing of subquery FROM clause doesn't allow for multiple level candidate expressions

Created: 05/Nov/09 12:05 PM   Updated: 26/Dec/09 12:56 PM   Resolved: 05/Nov/09 12:37 PM
Component/s: Queries
Affects Version/s: 1.1.6, 2.0.0.m1, 2.0.0.m2, 2.0.0.m3
Fix Version/s: 2.0.0.m4

 Description  « Hide
The JPQL query

SELECT DISTINCT c FROM Customer c WHERE EXISTS (SELECT o FROM c.orders o where o.totalPrice BETWEEN 1000 AND 1200)

now results in a generic compilation of

  [symbols: DATANUCLEUS_SUBQUERY_1 type=unknown, c type=com.sun.ts.tests.ejb30.persistence.query.language.schema30.Customer]
    [from:ClassExpression(candidate=c.orders alias=o)]
    [filter:DyadicExpression{DyadicExpression{PrimaryExpression{o.totalPrice} <= Literal{1200}} AND DyadicExpression{PrimaryExpression{o.totalPrice} >= Literal{1000}}}]
    [symbols: o type=com.sun.ts.tests.ejb30.persistence.query.language.schema30.Order]]

but the generated SQL doesn't add the necessary WHERE clauses to the subquery for the "c.orders" join

Andy Jefferson added a comment - 05/Nov/09 12:37 PM
SVN trunk now implements support for this

Andy Jefferson made changes - 05/Nov/09 12:37 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 26/Dec/09 12:56 PM
Status Resolved [ 5 ] Closed [ 6 ]