@Override public void update(String old_category_name, String new_category_name) throws ServiceException { logger.info("CategoryService.update"); try { categoryDAO.update(old_category_name, new_category_name); } catch (PersistenceException ex) { logger.error("CategoryService.update failed!"); throw (new ServiceException("Category update failed!")); } }
@Override public void create(String category_name) throws ServiceException { logger.info("CategoryService.create"); Category new_category = new Category(); new_category.setName(category_name); try { categoryDAO.create(new_category); } catch (PersistenceException ex) { logger.error("CategoryService.create failed!"); throw (new ServiceException("Category update failed!")); } }
@Override public List<String> list() { logger.info("CategoryService.list"); return categoryDAO.list(); }