1 2 3 4 5 6 7 8 | public Integer ejbCreate(OrderItemValue value) throws CreateException { if (value.getItemName() == null) { throw new CreateException("Cannot create Order without a name"); } .. .. return null; } |
1 2 3 4 5 6 7 8 | public ItemValueObject[] placeOrder(int n, ItemType itemType) throws NotEnoughStockException { //Check Inventory. Collection orders = ItemHome.findByItemType(itemType); if (orders.size() < n) { throw NotEnoughStockException("Insufficient stock for " + itemType); } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |