1
나는 나의 DAO 클래스의 모의를 만들고 싶다. 어떻게 GenericDao의 다음 메소드를 조롱 할 수 있습니까? 이 내부단위 테스트를위한 모의 DAO
public List<T> getList(int max, int p) throws DataAccessException {
String t= type.getT();
String sql = "from " + t+ " order by id desc";
List<T> o= HibernateUtils(type, this.getSession().createQuery(sql).setFirstResult(max* (p- 1)).setMaxResults(max).list());
return o;
}
뭔가 : 다음
@Override
public List<T> getList(int maxResults, int pageNumber) {
List<T> list = new ArrayList<T>();
//......
return list;
}
당신이 나에게 getListByPage 방법의 가능한 구현을 보여 주실 래요? thanks – unnamed
"pageNumber"는 무슨 뜻입니까? –
페이지 번호는 존재하는 총 페이지 수입니다. 내 webapp에서 pagiantion 않았다. – unnamed