Client's View

You've now seen how to specify, implement, and deploy BMP Entity beans, you will now look at how they are used. As you can probably imagine, the steps to obtain a reference to an Entity bean are similar to that for a Session bean:

1.
Look up the home interface for the Entity bean from JNDI.
2.
Use the relevant home.create() method to create a new entity instance.
3.
If the primary key is known, use home.findByPrimaryKey() to locate an existing entity instance, or some other home.findXxx() finder method to obtain a Collection of matching entities.
4.
Invoke the business methods on the local proxy returned from the finder and create methods defined in the local interface of the bean.

The javax.ejb.EJBLocalObject interface also defines ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.