posted 19 years ago
Question # 12:
Given CMP beans CustomerBean,OrderBean and LineItemsBean with the following relationships:
CustomerBean (1) <->OrderBean(n)
OrderBean (1) <-> LineItemsBean(n)
The following answers have been marked as correct in Answers section.
Question: Which will return orders that have lineitems?
Choice B - Select Distinct Object(o) FROM Order o, IN(o.lineItems) li
Choice D - Select Distinct Object(o) FROM Order o where o.lineItems is not empty.
I feel that only choice D should be correct, as the question says "Which EJB-QL will return orders THAT HAVE LINE ITEMS?"
In choice B we donot check if the collection referred is empty or not.
Any suggestions would be valuable ?
Regards,
Aleena
Aleena Rehman<br />SCJP, SCBCD 95%, SCWCD 85%, IBM-OOAD 84%, SCEA-I 91%