1 7 package org.jfox.petstore.bo; 8 9 import java.util.List ; 10 import java.util.Collections ; 11 import javax.ejb.EJB ; 12 import javax.ejb.Stateless ; 13 import javax.ejb.Local ; 14 15 import org.jfox.petstore.dao.CategoryDAO; 16 import org.jfox.petstore.entity.Category; 17 18 21 @Stateless 22 @Local 23 public class CategoryBOImpl implements CategoryBO{ 24 25 @EJB 26 CategoryDAO categoryDAO; 27 28 public Category getCategory(String categoryId) { 29 try { 30 return categoryDAO.getCategory(categoryId); 31 } 32 catch(Exception e) { 33 e.printStackTrace(); 34 return null; 35 } 36 } 37 38 public List <Category> getCategoryList() { 39 try { 40 return categoryDAO.getCategoryList(); 41 } 42 catch(Exception e) { 43 e.printStackTrace(); 44 return Collections.emptyList(); 45 } 46 } 47 } 48 | Popular Tags |