I found a related discussion
CMR field as return type in a select statement In Summary, are the following queries valid (refer to specs for the relationship between order and Product, Page 221):
1) SELECT l.product FROM Order AS o, IN(o.lineItems) l
2) SELECT l.product.name FROM Order AS o, IN(o.lineItems) l
Note: Name is a cmp field of product
According to HFEJB, page 406 (BANG) -- Both queries 1 and 2 are wrong.
According to spec 11.2.8, page 232 both are correct.
As of my
current stand , query 2 is OK. Query 1 is not correct.
I will try to deploy this code and confirm the answers. If anybody has already done it, please inform.
Thanks.