CMP? Finding all rows is easy. All you'd have to do is define a method like "public Collection findAll() throws FinderException, RemoteException" in your home interface, and tell the container how to implement this finder when deploying the bean. Since the last step is container-specific, I can't tell you anything more about that. But any container should be able to implement a finder returning all rows.
You would not implement any bean creation methods.
The difficult bit might be that your view may not be updateable, so you'll have to convince your
EJB container that it should not try to store the bean. Many containers offer facilities to avoid unnecessary stores by letting you either implement an isModified()-type callback on your bean, or indicate which methods don't modify the bean state.
If the number of records is large, performance is unlikely to be very good though. Finder methods just
love to get lists of primary keys first, then fire a separate select statement at the database for every single record
. You might want to consider a simple
JDBC query in a session bean which simply returns a Collection of value objects.
- Peter
[This message has been edited by Peter den Haan (edited May 19, 2001).]