PropertiesTemplateDAO { public List<com.wipro.ats.bdre.md.beans.table.PropertiesTemplate> listPropertyTemplate(Integer pageNum, Integer numResults) { Session session = sessionFactory.openSession(); List<com.wipro.ats.bdre.md.beans.table.PropertiesTemplate> propertiesTemplateList = new ArrayList<com.wipro.ats.bdre.md.beans.table.PropertiesTemplate>(); try { session.beginTransaction(); Criteria criteria = session.createCriteria(PropertiesTemplate.class); criteria.setFirstResult(pageNum); criteria.setMaxResults(numResults); List<PropertiesTemplate> jpaPropertiesTemplateList = criteria.list(); int counter = jpaPropertiesTemplateList.size(); for (PropertiesTemplate jpaPropertiesTemplate : jpaPropertiesTemplateList) { com.wipro.ats.bdre.md.beans.table.PropertiesTemplate newPropertiesTemplate = new com.wipro.ats.bdre.md.beans.table.PropertiesTemplate(); newPropertiesTemplate.setConfigGroup(jpaPropertiesTemplate.getConfigGroup()); newPropertiesTemplate.setKey(jpaPropertiesTemplate.getId().getPropTempKey()); newPropertiesTemplate.setDescription(jpaPropertiesTemplate.getDescription()); newPropertiesTemplate.setValue(jpaPropertiesTemplate.getPropTempValue()); newPropertiesTemplate.setProcessTemplateId(jpaPropertiesTemplate.getId().getProcessTemplateId()); newPropertiesTemplate.setCounter(counter); LOGGER.info("Config Group of PropertiesTemplate is " + newPropertiesTemplate.getConfigGroup()); propertiesTemplateList.add(newPropertiesTemplate); } session.getTransaction().commit(); } catch (MetadataException e) { session.getTransaction().rollback(); LOGGER.error(e); } finally { session.close(); } return propertiesTemplateList; }  List<com.wipro.ats.bdre.md.beans.table.PropertiesTemplate> listPropertiesTemplateBean(Integer processTemplateId); List<com.wipro.ats.bdre.md.beans.table.PropertiesTemplate> listPropertyTemplate(Integer pageNum, Integer numResults); List<PropertiesTemplate> list(Integer pageNum, Integer numResults); Long totalRecordCount(); PropertiesTemplate get(PropertiesTemplateId propertiesTemplateId); com.wipro.ats.bdre.md.beans.table.PropertiesTemplate insertProcessTemplate(com.wipro.ats.bdre.md.beans.table.PropertiesTemplate propertiesTemplate); PropertiesTemplateId insert(PropertiesTemplate propertiesTemplate); com.wipro.ats.bdre.md.beans.table.PropertiesTemplate updateProcessTemplate(com.wipro.ats.bdre.md.beans.table.PropertiesTemplate propertiesTemplate); void update(PropertiesTemplate propertiesTemplate); void deletePropertiesTemplate(Integer processTemplateId); void deletePropertyTemplate(Integer processTemplateId, String key); void delete(PropertiesTemplateId propertiesTemplateId);  }
@Test public void listPropertyTemplateTest() throws Exception { List<com.wipro.ats.bdre.md.beans.table.PropertiesTemplate> tableProperties = propertiesTemplateDAO.listPropertyTemplate(0, 10); for (com.wipro.ats.bdre.md.beans.table.PropertiesTemplate propertiesTemplate : tableProperties) { LOGGER.info("properties Template:" + propertiesTemplate); } }