tailieunhanh - Enterprise Java and UML 2nd Edition PHẦN 2
10 ChargeCodeEntityBean /** Create a ChargeCodeBean with the specified parameters. This Æ is never called directly. */ public ChargeCodePK ejbCreate(long id, String name, String description, ProjectLocal project) throws CreateException { setId(id); setName(name); setDescription(description); return null; } /** Actions performed after creation. This is never called directly. */ public void ejbPostCreate(long id, String name, String description, ProjectLocal project) { setProject(project); } } ClientEntityBean is the local Business interface for the Client entity bean. It defines all of the locally accessible methods for the Client entity bean. package ; import .*; import .*; /** * The ClientInt is the interface that ties the Bean with. | 10 ChargeCodeEntityBean Create a ChargeCodeBean with the specified parameters. This is never called directly. public ChargeCodePK ejbCreate long id String name String description ProjectLocal project throws CreateException setId id setName name setDescription description return null Actions performed after creation. This is never called directly. public void ejbPostCreate long id String name String description ProjectLocal project setProject project ClientEntityBean is the local Business interface for the Client entity bean. It defines all of the locally accessible methods for the Client entity bean. package import . import . The ClientInt is the interface that ties the Bean with the Remote interface to provide compile time type checking. public interface ClientInt Answers the name of this Client. public String getName Answers the description of this Client. public String getDescription Answers all the projects of this Client. 11 12 ClientEntityBean public Collection getProjects is the local EJB interface for the Client entity bean that inherits from ClientInt. package import . import . The Client bean holds descriptive information about a client. ClientLocal is the local interface through which local clients access the underlying entity bean. public interface ClientLocal extends EJBLocalObject ClientInt is the Home interface for the Client entity bean. It defines the methods for finding and creating Client entity beans. package import . import . The Client bean holds descriptive information about a client. ClientLocalHome is the local interface through which local clients find and create the underlying entity beans. public interface ClientLocalHome extends EJBLocalHome .
đang nạp các trang xem trước