try {
MonthlyReport monthReport = m_monthlyReportDao.findReportByDomainNamePeriod(report.getPeriod(),
report.getDomain(), report.getName(), MonthlyReportEntity.READSET_FULL);
if (monthReport != null) {
MonthlyReportContent reportContent = m_monthlyReportContentDao.createLocal();
reportContent.setKeyReportId(monthReport.getId());
reportContent.setReportId(monthReport.getId());
m_monthlyReportDao.deleteReportByDomainNamePeriod(report);
m_monthlyReportContentDao.deleteByPK(reportContent);
}
} catch (Exception e) {
Cat.logError(e);
}
try {
m_monthlyReportDao.insert(report);
int id = report.getId();
MonthlyReportContent proto = m_monthlyReportContentDao.createLocal();
proto.setReportId(id);
proto.setContent(content);
m_monthlyReportContentDao.insert(proto);
return true;
} catch (DalException e) {
Cat.logError(e);