With CMP entity beans, how can you do things like:
SELECT COUNT(*) FROM PRODUCTS
SELECT MAX(salary) FROM EMPLOYEES
I know I could write an ejbHome method that first calls a findAll() ejbFinder method, then calls size() on the returned collection to immitate a SELECT COUNT(*), or iterates through all elements of the collection to immitate a SELECT MAX(...), but both operation would be incredibly expensive compared to a true SQL call.
Why does your home method have to finadAll()? It can make COUNT(*) SQL calls directly. For all intents and purposes, home methods in entity beans are the same as regular methods in stateless session beans.
agree... sometime i think it's why we don't do all these extra SQL works in the *Home* rather than putting them into the session bean... i see it adding some extra work to do that..