UserRolesDAO { public List<UserRoles> list(Integer pageNum, Integer numResults) { Session session = sessionFactory.openSession(); session.beginTransaction(); Criteria criteria = session.createCriteria(UserRoles.class); criteria.setFirstResult(pageNum); criteria.setMaxResults(numResults); List<UserRoles> userRoles = criteria.list(); session.getTransaction().commit(); session.close(); return userRoles; }  List<UserRoles> list(Integer pageNum, Integer numResults); Map<Integer,String> diffRoleList(); List<UserRoles> listByName(String userName); UserRoles minUserRoleId(String userName); Integer totalRecordCount(); UserRoles get(Integer id); Integer insert(UserRoles userRoles); void update(UserRoles userRoles); void delete(Integer id);  }
@Ignore @Test public void testList() throws Exception { LOGGER.info("Size of UserRoles is atleast:" + userRolesDAO.list(0, 10).size()); }