On page 405, it shows a EJB-QL query for a home method. It is my understanding that queries are only defined for finder and select methods, not home methods. If this is a query for the ejbSelectGetMoviesByDirectorAndGenre() method then it is incorrect because the querty should be returning a collection of movie objects not just their titles. This is evident if you examine the ejbHomeListMoviesByDirectorAndGenre code on the bottom of page 396. What gives?
Howdy -- ALL home business methods (i.e methods that are not finder methods) will be implemented via your ejbSelect methods, so the EJB-Ql that is shown for home business methods always means that it is a query for a select method. I should have shown the whole thing, complete with the select methods, but I didn't. So you'll just have to imagine the select methods that you'd use to do this. In other words, I am showing you how the home business method maps to a query, but I'm not showing the intermediate steps of the select method. Actually, that's a good exercise for you -- figure out what the select method might look like cheers, Kathy
The return type of the home business method is String. What if the query were to return more than one record? How would multiple directorIDs fit into a single string?
If you read page 278 of HFE, it says that the Home method can return any values as long as it is RMI-IIOP complaint. In the example that was given, the return type was string. But I assume you can even return that Collection you got from the ejbSelect method.
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCEA
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.