KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > petstore > bo > OrderBOImpl


1 /*
2  * JFox - The most lightweight Java EE Application Server!
3  * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
4  *
5  * JFox is licenced and re-distributable under GNU LGPL.
6  */

7 package org.jfox.petstore.bo;
8
9 import java.util.List JavaDoc;
10 import java.sql.SQLException JavaDoc;
11 import javax.ejb.Local JavaDoc;
12 import javax.ejb.Stateless JavaDoc;
13 import javax.ejb.EJB JavaDoc;
14 import javax.ejb.EJBException JavaDoc;
15
16 import org.jfox.petstore.entity.Order;
17 import org.jfox.petstore.dao.OrderDAO;
18
19 /**
20  * @author <a HREF="mailto:jfox.young@gmail.com">Young Yang</a>
21  */

22 @Stateless JavaDoc
23 @Local JavaDoc
24 public class OrderBOImpl implements OrderBO {
25
26     @EJB JavaDoc
27     OrderDAO orderDAO;
28
29     public Order getOrder(long orderId) {
30         try {
31             return orderDAO.getOrder(orderId);
32         }
33         catch (SQLException JavaDoc e) {
34             throw new EJBException JavaDoc(e);
35         }
36     }
37
38     public List JavaDoc<Order> getOrdersByUsername(String JavaDoc username) {
39         try {
40             return orderDAO.getOrdersByUsername(username);
41         }
42         catch (SQLException JavaDoc e) {
43             throw new EJBException JavaDoc(e);
44         }
45     }
46
47     public void insertOrder(Order order) {
48         try {
49             orderDAO.insertOrder(order);
50         }
51         catch (Exception JavaDoc e) {
52             throw new EJBException JavaDoc(e);
53         }
54     }
55
56     public static void main(String JavaDoc[] args) {
57
58     }
59 }
60
Popular Tags