BatchDAO { public List<Batch> list(Integer pageNum, Integer numResults) { Session session = sessionFactory.openSession(); session.beginTransaction(); Criteria criteria = session.createCriteria(Batch.class).addOrder(Order.desc("batchId")); criteria.setFirstResult(pageNum); criteria.setMaxResults(numResults); List<Batch> batches = criteria.list(); session.getTransaction().commit(); session.close(); return batches; }  List<Batch> list(Integer pageNum, Integer numResults); Integer totalRecordCount(); Batch get(Long id); Long insert(Batch batch); void update(Batch batch); void delete(Long id);  }
@Ignore @Test public void testList() throws Exception { LOGGER.info("Size of Batch is atleast:" + batchDAO.list(0, 10).size()); }