# Part Two: Defining an Entity Relationship

In part one of the tutorial you imported the Band entity bean, created the Music session bean, which referenced the Band bean, and ran two page flows that called the Music bean to add and list bands. In part two of the tutorial you will add a second entity bean called Recording and define the relationship between the Recording and Band beans. After updating the session bean to enable client applications to add a recording and receive a listing of recordings for a given band, you will run a page flow to add and list bands and recordings. Finally, you will create an EJB control and a test web service to test the Band bean directly.

## Steps in Part Two

Step 5: Create a New Entity Bean

In this step you create the entity bean Recording and add an entity relation between the Band and Recording beans.

Step 6: Update the Band Entity Bean

In this step you update the Band bean and add component methods to add a recording a get a list of recordings.

Step 7: Update the Session Bean

In this step you add business methods to the Music bean that invoke the new methods defined for the Band bean.

Step 8: Run a Web Application

In this step you will test the EJBs by running a new client application.

Step 9: Build and Run a Web Service Application

In this step you will develop an EJB control and generate a test web service to test the Band bean.

Related Topics

Developing Enterprise JavaBeans

Click one of the following arrows to navigate through the tutorial: