Defining the Home Interfaces

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

Defining the Order Home Interfaces

Both the local and remote home interfaces of the order provide methods for creating and finding the instances of the bean based on the primary key.

Listing 12.1 shows the OrderHome remote home interface.

Listing 12.1. The Full Text of day12/OrderHome.java
package day12;
import java.util.*;
import java.rmi.*;
import javax.ejb.*;
public interface OrderHome extends EJBHome {
   /* Create methods */
   public Order create(String studentId,
     String status, double amount) throws CreateException, RemoteException; /* Finder methods */ public Order findByPrimaryKey(String ...

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.