1 package org.springframework.samples.jpetstore.dao.ibatis; 2 3 import java.util.List ; 4 5 import org.springframework.dao.DataAccessException; 6 import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport; 7 import org.springframework.samples.jpetstore.dao.CategoryDao; 8 import org.springframework.samples.jpetstore.domain.Category; 9 10 public class SqlMapCategoryDao extends SqlMapClientDaoSupport implements CategoryDao { 11 12 public List getCategoryList() throws DataAccessException { 13 return getSqlMapClientTemplate().queryForList("getCategoryList", null); 14 } 15 16 public Category getCategory(String categoryId) throws DataAccessException { 17 return (Category) getSqlMapClientTemplate().queryForObject("getCategory", categoryId); 18 } 19 20 } 21 | Popular Tags |