ProcessLogDAO { public void log(ProcessLogInfo processLogInfo) { Session session = sessionFactory.openSession(); try { session.beginTransaction(); ProcessLog processLog = new ProcessLog(); processLog.setProcess((Process) session.get(Process.class, processLogInfo.getProcessId())); LOGGER.info("processid is" + processLogInfo.getProcessId()); processLog.setAddTs(processLogInfo.getAddTs()); processLog.setLogCategory(processLogInfo.getLogCategory()); processLog.setMessage(processLogInfo.getMessage()); processLog.setMessageId(processLogInfo.getMessageId()); processLog.setInstanceRef(processLogInfo.getInstanceRef()); session.save(processLog); session.getTransaction().commit(); } catch (MetadataException e) { session.getTransaction().rollback(); LOGGER.error(e); } finally { session.close(); } }  List<ProcessLog> list(Integer pageNum, Integer numResults); Integer totalRecordCount(); ProcessLog get(Long id); Long insert(ProcessLog processLog); void update(ProcessLog processLog); void delete(Long id); void log(ProcessLogInfo processLogInfo); void logList(List<ProcessLogInfo> processLogInfoList); ProcessLogInfo getLastValue(ProcessLogInfo processLogInfo); List<ProcessLogInfo> listLog(ProcessLogInfo processLogInfo); List<ProcessLogInfo> getProcessLog(ProcessLogInfo processLogInfo); List<ProcessLogInfo> listLastInstanceRef(int processId, String messageId);  }
@Test @Ignore public void testLog() throws Exception { ProcessLogInfo processLogInfo = new ProcessLogInfo(); processLogInfo.setProcessId(5); processLogInfo.setAddTs(new Date()); processLogInfo.setMessage("Test1"); processLogInfo.setMessageId("Test2"); processLogInfo.setLogCategory("Test3"); processLogDAO.log(processLogInfo); LOGGER.debug("Check DB to find new log"); }