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