IntermediateDAO { public Long totalRecordCount() { Session session = sessionFactory.openSession(); session.beginTransaction(); long size = session.createCriteria(Intermediate.class).list().size(); session.getTransaction().commit(); session.close(); return size; }  List<Intermediate> list(Integer pageNum, Integer numResults); Long totalRecordCount(); Intermediate get(IntermediateId intermediateId); IntermediateId insert(Intermediate intermediate); void update(Intermediate intermediate); void delete(IntermediateId intermediateId);  }
@Ignore @Test public void testTotalRecordCount() throws Exception { LOGGER.info("Total intermediate is:" + intermediateDAO.totalRecordCount()); }