BatchDAO { public Integer totalRecordCount() { Session session = sessionFactory.openSession(); session.beginTransaction(); Criteria criteria = session.createCriteria(Batch.class); Integer size = criteria.list().size(); session.getTransaction().commit(); session.close(); return size; }  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 testTotalRecordCount() throws Exception { LOGGER.info("Size of Batch is:" + batchDAO.totalRecordCount()); }