ProcessDAO { public void delete(Integer id) { Session session = sessionFactory.openSession(); try { session.beginTransaction(); Process process = (Process) session.get(Process.class, id); process.setDeleteFlag(true); session.update(process); List<Process> subProcessList = subProcesslist(id); if (!subProcessList.isEmpty()){ for(Process subProcess : subProcessList){ subProcess.setDeleteFlag(true); session.update(subProcess); } } session.getTransaction().commit(); } catch (MetadataException e) { session.getTransaction().rollback(); LOGGER.error(e); } finally { session.close(); } }  List<com.wipro.ats.bdre.md.dao.jpa.Process> list(Integer pid, Integer processTypeId,Integer pageNum, Integer numResults,String userName); List<com.wipro.ats.bdre.md.dao.jpa.Process> processList(); Integer totalRecordCount(Integer pid,Integer processTypeId); Integer totalCount(); Process get(Integer id); Process getParent(Integer id); Integer insert(Process process); Process update(Process process); void delete(Integer id); void testDelete(Integer id); List<com.wipro.ats.bdre.md.dao.jpa.Process> subProcesslist(Integer processId); String getParentProcessTypeId(Integer pid); String getProcessTypeName(Integer pid); List<Process> selectProcessList(Integer processId); List<Process> selectProcessList(String processCode,String username); Process returnProcess(String processCode,String username); List<Process> returnProcesses(String processCode); void updateProcessId(Integer oldProcessId, Integer newProcessId); Process cloneProcess(Integer processId); List<ProcessInfo> selectProcessListWithExec(Integer processId, Long instanceExecId); List<Process> createOneChildJob(Process parentProcess, Process childProcess, List<Properties> parentProps, List<Properties> childProps ); List<Process> createHiveMigrationJob(Process parentProcess, List<Process> childProcesses, List<Properties> parentProperties); List<Process> createAnalyticsAppJob(Process parentProcess, List<Process> childProcesses, List<Properties> appProperties); List<Process> createDataloadJob(Process parentProcess, List<Process> childProcesses, List<Properties> parentProps, Map<Process,List<Properties>> childProps ); String securityCheck(Integer processId,String username,String action); List<com.wipro.ats.bdre.md.dao.jpa.Process> listByName(String processName); List<Process> getDownStreamProcess(Integer pid);  }
@Ignore @Test public void testDelete() throws Exception { processDAO.testDelete(10837); LOGGER.info("Deleted process with ID:"); }