Entity Beans   «Prev 
122

How do you find an entity bean using the primary key?

1) The client invokes the findByPrimaryKey() method of the home object passing it the primaryKey object.

2) The container creates an instance of the bean and asks it to look up the data.

3) The instance looks up the data and, if the key matches some data, the data is read into the bean instance.

4) The bean instance returns control to the container.

5) The container creates an EJBObject for the primary keys.

6) The home object returns the EJBObject remote reference to the client. The client can then access the bean instance for that primary key.