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 key)
      throws FinderException, RemoteException;
}

Listing 12.2 shows the OrderLocalHome local home interface.

Listing 12.2. The Full Text of day12/OrderLocalHome.java
package day12;
import java.util.*;
import java.rmi.*;
import javax.ejb.*;
public interface OrderLocalHome extends EJBLocalHome {
   /* Create methods */
   public OrderLocal create(String studentId,
      String status, double amount) throws CreateException;
   /* Finder methods */
   public OrderLocal findByPrimaryKey(String key)
      throws FinderException;
}

Defining the OrderLineItemLocalHome Home Interface

The local home interfaces of the line items provide methods for creating and finding the instances of the bean based on the primary key. Listing 12.3 shows the OrderLineItemLocalHome local home interface.

Listing 12.3. The Full Text of day12/OrderLineItemLocalHome.java
package day12;
import javax.ejb.*;
import java.util.*;
public interface OrderLineItemLocalHome extends EJBLocalHome {
   public OrderLineItemLocal create(String orderLineItemId,
        String courseId, double fee) throws CreateException;
   public OrderLineItemLocal findByPrimaryKey(String key)
        throws FinderException;
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.46.78