?? shopcommodityprocejavabean.java
字號:
package flowershoporder.ejb;import java.util.*;import javax.ejb.*;import javax.sql.*;import java.sql.*;import javax.naming.*;import flowershoporder.*;//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//這是EntityBean(ShopCommodityProcEJB)的Bean Class類//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -public class ShopCommodityProcEJavaBean implements EntityBean { public String commodityid = null; public String commodityname = null; public int unitprice = 0; private EntityContext entitycontext = null; //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //定義回調(diào)方法(callback method) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public void setEntityContext(EntityContext context) { this.entitycontext = entitycontext; } public void unsetEntityContext() { entitycontext = null; } public String ejbCreate(String commodityid) throws DuplicateKeyException, CreateException { this.commodityid = commodityid; this.commodityname = ""; this.unitprice = 0; return null; } public void ejbPostCreate(String commodityid) {} public String ejbCreate(String commodityid,String commodityname,int unitprice) throws DuplicateKeyException, CreateException { this.commodityid = commodityid; this.commodityname = commodityname; this.unitprice = unitprice; return null; } public void ejbPostCreate(String commodityid,String commodityname,int unitprice) {} public void ejbLoad() {} public void ejbStore() {} public void ejbActivate() { commodityid = (String)entitycontext.getPrimaryKey(); } public void ejbPassivate() { commodityid = null; commodityname = null; unitprice = 0; } public void ejbRemove() {} //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //定義business方法,這里的business方法同ReaderInfoRemoteInt接口中 //business方法要一一對應(yīng) //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public void setCommodityname(String commodityname) { this.commodityname = commodityname; } public void setUnitprice(int unitprice) { this.unitprice = unitprice; } public void setCommodityInfomation(String commodityname,int unitprice) { this.commodityname = commodityname; this.unitprice = unitprice; } public String getCommodityname() { return commodityname; } public int getUnitprice() { return unitprice; } public ShopCommodity getCommodityInfomation() { ShopCommodity shopcommodity = new ShopCommodity(commodityid,commodityname,unitprice); return shopcommodity; } }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -