KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.Collections JavaDoc;
11 import javax.ejb.EJB JavaDoc;
12 import javax.ejb.Stateless JavaDoc;
13 import javax.ejb.Local JavaDoc;
14
15 import org.jfox.petstore.dao.CategoryDAO;
16 import org.jfox.petstore.entity.Category;
17
18 /**
19  * @author <a HREF="mailto:jfox.young@gmail.com">Young Yang</a>
20  */

21 @Stateless JavaDoc
22 @Local JavaDoc
23 public class CategoryBOImpl implements CategoryBO{
24
25     @EJB JavaDoc
26     CategoryDAO categoryDAO;
27
28     public Category getCategory(String JavaDoc categoryId) {
29         try {
30             return categoryDAO.getCategory(categoryId);
31         }
32         catch(Exception JavaDoc e) {
33             e.printStackTrace();
34             return null;
35         }
36     }
37
38     public List JavaDoc<Category> getCategoryList() {
39         try {
40             return categoryDAO.getCategoryList();
41         }
42         catch(Exception JavaDoc e) {
43             e.printStackTrace();
44             return Collections.emptyList();
45         }
46     }
47 }
48
Popular Tags