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 ...
Get Sams Teach Yourself J2EE™ in 21 Days 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.