正在加载图片...
编写 Entity Bean类(Part2) //Part1 public String ejbCreate(string state Code, float taxRate) throws Create Exception if(state Code == nullR throw new Create Exception ("the State Code is required )i this, state Code s statecode: this taxRate s taxRate: return null ejbCreate方法实现 public void ejbPostcreate(String state Cade, 实现在Home接口中的 public void ejbload ot 定义的 create方法对应的 if(state Code != null) ejbCreate方法 state Code. trim o; 对于CMP,客户调用 create会导致数据库中插入一条 public void ejbstore仆 public void ejbRemove0t 记录,在数据库插入记录之前, 容器会调用 ejbCreate方法,允 public void setEntitycontext(EntityContextd许用户设置各字段的值 public void ejbActivate(& public void ejbPassivateo]编写Entity Bean类(Part 2) //Part1 public String ejbCreate(String stateCode, float taxRate) throws CreateException{ if(stateCode == null){ throw new CreateException("The State Code is required."); } this.stateCode = stateCode; this.taxRate = taxRate; return null; } public void ejbPostCreate(String stateCode, float taxRate){} public void ejbLoad(){ if(stateCode != null) stateCode.trim(); } public void ejbStore() {} public void ejbRemove() {} public void unsetEntityContext() {} public void setEntityContext(EntityContext context) {} public void ejbActivate() {} public void ejbPassivate() {} } ejbCreate方法实现: 实现在Home接口中的 定义的create方法对应的 ejbCreate方法。 对于CMP,客户调用 create会导致数据库中插入一条 记录,在数据库插入记录之前, 容器会调用ejbCreate方法,允 许用户设置各字段的值
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有