正在加载图片...
编写 Entity Bean类(Part2) //Part1 public String ejbCreate(String state Code, float taxR throws CreateException if(state Code ==null Entity Context throw new create Exceptio Entity Context是 Entity bean与容器交互的接口。 this state code= state Code this. taxRate taxRate return null public void ejbPostCreate(String state Code, float taxRate)3 public void ejbLoadot if(state Code != null state Code. trj/ho } public void ejbstoreot public void ejbremoveot public void unsetEntity Context(t public yoid setEntity 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() {} } EntityContext: EntityContext是Entity bean与容器交互的接口
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有