正在加载图片...
编写 Entity Bean类(Part2) //Part1 public String ejbcreate(string state Code, float taxRate throws CreateException if(state Code ==null throw new Create EXception " The State Code is required. " this state code= state Code this. taxRate taxRate return null public void ejbPostCreate(String state Code, float t! public void ejbLoadot if(state Code != null 对于cMP, find By primary key state Code. trimo 方法由容器实现,不需要自己编 } 写代码 public void ejbstoreot public void ejbRemove0t public void unsetEntity Contextot public void set Entity Context(Entity Context context public void ejbActivateot ublic void ejbPassivate(仆 }编写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() {} } 对于CMP,findByPrimaryKey 方法由容器实现,不需要自己编 写代码
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有