Hi, you are perfectly right. From Pro EJB persistent book:
The result type of a select query is the type corresponding to each row in the result set produced by executing the query. This may include entities, primitive types and other persistent attribute types, but never a collection type. The following query is illegal: SELECT d.employees FROM Department d
Hi Sergio, All these queries have been tested on Sun's reference implementation and the query under discussion works as well. I am trying to find an appropriate citation from the specification [ September 08, 2008: Message edited by: Paul Anil ]
Thank you. In fact, I did test it using glassfish and it works as stated by Enthuware. However, accordingly to the specification (section 4.8) it shouldn't be the case.
I'll copy the quote here:
Note that the SELECT clause must be specified to return only single-valued expressions. The query below is therefore invalid: SELECT o.lineItems from Order AS o
BTW, have you taken a look at this other topic? I tested using glassfish and the results were the same as what I was expecting (and different to enthuware's).
And thank you for your support and great product. Other than these two minor doubts, I found your product excellent and absolutely worth the price. [ September 08, 2008: Message edited by: Sergio Tridente ]