Creating the Entity Beans

The first step in defining your entity beans is the creation of the Remote interfaces. If you did a thorough job in the design phase, you already know all the methods that you need in the Remote interface. If not, you'll probably change the interfaces many times before you get them right. To be honest, even if you modeled the system well, you're probably still going to make changes to the interfaces—but not as many. Listing 50.1 shows the Remote interface for the Customer bean. In addition to the basic data types, notice that the bean can return itself as a view object.

Code Listing 50.1. Source Code for Customer.java
 package usingj2ee.shopping; import java.rmi.*; import javax.ejb.*; import java.util.Collection; import ...

Get Special Edition Using Java™ 2 Enterprise 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.