ProcessTypeDAO { public Integer totalRecordCount(Integer processTypeId) { Session session = sessionFactory.openSession(); session.beginTransaction(); Integer size; if (processTypeId == null) { Criteria parentProcessTypeCriteria = session.createCriteria(ProcessType.class).add(Restrictions.isNull(PARENTPROCESSTYPEID)); size = parentProcessTypeCriteria.list().size(); } else { Criteria processTypeCriteria = session.createCriteria(ProcessType.class).add(Restrictions.eq(PARENTPROCESSTYPEID, processTypeId)); size = processTypeCriteria.list().size(); } session.getTransaction().commit(); session.close(); return size; }  List<ProcessType> list(Integer processTypeId); List<ProcessType> listFull(Integer pageNum, Integer numResults); Integer totalRows(); Integer totalRecordCount(Integer processTypeId); ProcessType get(Integer id); Integer insert(ProcessType processType); void update(ProcessType processType); void delete(Integer id);  }
@Ignore @Test public void testTotalRecordCount() throws Exception { LOGGER.info("Size of ProcessType is:" + processTypeDAO.totalRecordCount(null)); }