Defining the Remote Interfaces

We define both local and remote interfaces for the order entity bean, but only the local interface for the line item entity bean.

Defining the Order Interfaces

Both the local and remote home interfaces of the order entity bean provide methods for accessing the bean's persistent fields. In addition, they contain the business methods addLineItem() and getOrderLineItems(). The addLineItem() method is used to add a line item to the order. The getOrderLineItems() returns a collection of ClientLineItem objects (as opposed to OrderLineItemLocal objects).

Listing 12.4 shows the Order remote interface.

Listing 12.4. The Full Text of day12/Order.java
 package day12; import java.util.*; import java.rmi.*; import javax.ejb.*; ...

Get Sams Teach Yourself EJB 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.