当前页面: 开发资料首页 → J2EE 专题 → EJB设计模式3
摘要: EJB设计模式3
Code snippet for Company Entity Bean其余的代码比如getdata()和setdata()方法的实现和设计模式2中
public class CompanyBean extends CompanyStruct
implements EntityBean {
EntityContext entityContext;
//all fields in CompanyStruct are available for CMP
public Integer ejbCreate(CompanyStruct Struct)
throws CreateException {
this.comId = struct.comId; //set the primary key
setData(struct);//this removes some redundant code
return null;
}