posted 20 years ago
Given:
CustomerBean (1) <--> OrderBean (n)
OrderBean <--> LineItemBean (n)
In order to return a set of customers that have orders, can I confirm that the following two queries are correct. One thing that I'd like to be 100% sure is that in (a), if c.orders is empty, then no customer will be returned.
(a)
SELECT DISTINCT OBJECT (c)
FROM Customer c, IN (c.orders) o
(b)
SELECT DISTINCT OBJECT (c)
FROM Customer c
WHERE c.orders IS NOT EMPTY
SCJP 1.4, SCWCD 1.3, SCBCD 1.3