O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Client's View

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

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

The javax.ejb.EJBLocalObject interface also defines a number of other ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required