String sql = "delete from reportexecution where testRound_id = " + sessionBean.getTestRoundId();
getEntityManager().createNativeQuery(sql).executeUpdate();
Long roundId = sessionBean.getTestRoundId();
TestRound testRound = (TestRound)getEntityManager().find(TestRound.class, roundId);
logCheckPointList.getLogCheckPoint().setTestRoundNo(testRound.getRoundNo());
List<LogCheckPoint> logs = logCheckPointList.getResultList();
HashMap<String, ReportExecution> caseHashMap = new HashMap<String, ReportExecution>();
for (LogCheckPoint log : logs) {
String caseNo = log.getTestCaseNo();
TestCase testCase = null;
String sql2 = "select testCase from TestCase testCase where caseNo = '" + caseNo + "'";
List list = getEntityManager().createQuery(sql2).getResultList();
if (list.size() > 0) {
testCase = (TestCase)list.get(0);
}
if (!caseHashMap.containsKey(caseNo)) {
ReportExecution rp = new ReportExecution();
testRound.setName(log.getTestRoundName());
rp.setTestRound(testRound);
rp.setTestCase(testCase);
rp.setCaseResult(log.getCpResult());