Posted By:
Noel_Byron
Posted On:
Friday, March 1, 2002 05:35 AM
With EJB 2.0 you can use the EJB query language. With EJB 1.1 your application server vendor should provide a tool to create such queries.
But think about this: a find method returns a bunch of primary keys. After that you would have to create a entity bean for each of the returned keys! That is nonsens. Imagine you need to fetch 100 rows. That means you access the database with 100 different selects. Not to mention the communication overhead from your client to the appliaction server.
That means you will end up with a session bean that does one select to supply your client with the data of several rows. Look at all those 'design patterns' addressing this issue on the web and forget about the find methods returning several keys.
I would recommend you to read this article:
http://www.bad-managers.com/Features/ejb/
Kind regards and good luck
Noel