Specifying a BMP Entity Bean

Following the pattern of Session beans, specifying an Entity bean involves defining the local-home and the local interface:

  • The local-home interface extends javax.ejb.EJBLocalHome.

  • The local interface extends javax.ejb.EJBLocalObject.

A discussion on each of these interfaces follows.

Local-Home Interface

Listing 6.1 shows the complete JobLocalHome interface as an example.

Listing 6.1. JobLocalHome Interface
 1: package data; 2: 3: import java.rmi.*; 4: import java.util.*; 5: import javax.ejb.*; 6: 7: public interface JobLocalHome extends EJBLocalHome 8: { 9: JobLocal create (String ref, String customer) throws CreateException; 10: JobLocal findByPrimaryKey(JobPK key) throws FinderException; 11: Collection findByCustomer(String ...

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