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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.