persistence@glassfish.java.net

JPQL: subquery changes

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Mon, 20 Mar 2006 16:23:18 +0100

Hi Tom,

attached are my changes for better subquery support. With these changes
the SelectGenerationContext created for a subquery does not share its
expression cache with the one for the outer query. Instead it generates
an Expression.equal call for all variables used in the subquery that are
declared in the outer query, e.g. the variable c in the following examples:
   SELECT c FROM Customer c WHERE EXISTS (SELECT o FROM c.orders o)
   SELECT c FROM Customer c WHERE EXISTS
    (SELECT o FROM Order o WHERE o.customer.name = c.name)

Please have a look, thanks!

Regards Michael