May 20, 2004

EJB CMP Finders and flexibility

A few days ago, I was playing around with custom finders in an entity bean and ordering the output, etc. After some research and suggestions from John, I decided to scrap the custom finders and implement a stateless session bean that would do the queries for me. This makes weird joins, order by clauses, and logic based where clauses possible without using something that is container specific.

The stateless session bean queries the database and grabs a list of primary keys. The bean then calls the entity beans "findByPrimaryKey" finder to grab the individual entity beans. This will allow me to easily add paging to my results, without populating all X number of entity beans. I can grab only the 10 or so that I want, save time and memory, and provide for decent performance.

Posted by doug at May 20, 2004 09:52 PM
Comments
Post a comment









Remember personal info?