BusDomainDAO { public Long totalRecordCount() { Session session = sessionFactory.openSession(); session.beginTransaction(); Criteria criteria = session.createCriteria(BusDomain.class); long size = criteria.list().size(); session.getTransaction().commit(); session.close(); return size; }  List<BusDomain> list(Integer pageNum, Integer numResults); Long totalRecordCount(); BusDomain get(Integer busDomainId); Integer insert(BusDomain busDomain); void update(BusDomain busDomain); void delete(Integer busDomainId);  }
@Ignore @Test public void testTotalRecordCount() throws Exception { LOGGER.info("Size of Busdomain is: " + busDomainDAO.totalRecordCount()); }