?? inventorywebimpl.java
字號:
package apusic.myshop.inventory.web;import java.rmi.RemoteException;import javax.ejb.FinderException;import apusic.myshop.util.Debug;import apusic.myshop.util.EJBUtil;import apusic.myshop.inventory.ejb.InventoryHome;import apusic.myshop.inventory.ejb.Inventory;public class InventoryWebImpl { public InventoryWebImpl() { } public int getInventory(String productId){ try{ InventoryHome inventoryHome = EJBUtil.getInventoryHome(); Inventory inventory = inventoryHome.findByProductId(productId); return inventory.getQty(); } catch (RemoteException re) { Debug.println("InventoryBean: Unable to locate invetory for item " + productId); } catch (FinderException fe) { Debug.println("InventoryBean: Unable to locate invetory for item " + productId); } return 0; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -