@SuppressWarnings("unchecked") public ReportListVoCollection listReports() { StringBuffer hql = new StringBuffer(); hql.append("from ReportBo as r1_1 left join r1_1.templates as t1_1"); hql.append(" where"); hql.append(" (r1_1.isActive =" + Boolean.TRUE + " and t1_1.isActive =" + Boolean.TRUE+" )"); //hql.append(" and r1_1.isRIE is null"); DomainFactory factory = getDomainFactory(); List list = factory.find(hql.toString()); return ReportListVoAssembler.createReportListVoCollectionFromReportBo(list).sort(); }
public ReportListVo getReport(ReportBoRefVo voRef) { DomainFactory factory = getDomainFactory(); ReportBo dom = (ReportBo)factory.getDomainObject(ReportBo.class, voRef.getID_ReportBo()); ReportListVo vo = ReportListVoAssembler.create(dom); return vo; }
@SuppressWarnings("unchecked") public ims.admin.vo.ReportListVoCollection searchReports(String reportName, String templateName, ReportsCategoryRefVo categoryRef) { StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append("select rep from ReportsCategory as cat right join cat.reports as rep left join rep.templates as tpl "); cond.append(andStr + "rep.isActive = :isActive"); markers.add("isActive"); values.add(Boolean.TRUE); andStr = " and "; cond.append(andStr + "UPPER(rep.reportName) like UPPER(:reportName)"); markers.add("reportName"); values.add(reportName); andStr = " and "; cond.append(andStr + "tpl.isActive = :isActive"); markers.add("isActive"); values.add(Boolean.TRUE); andStr = " and "; cond.append(andStr + "UPPER(tpl.name) like UPPER(:templateName)"); markers.add("templateName"); values.add(templateName); andStr = " and "; if(categoryRef != null && categoryRef.getID_ReportsCategoryIsNotNull()) { cond.append(andStr + "cat.id = :catId"); markers.add("catId"); values.add(categoryRef.getID_ReportsCategory()); andStr = " and "; } if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); DomainFactory factory = getDomainFactory(); List list = factory.find(hql.toString(), markers, values); return ReportListVoAssembler.createReportListVoCollectionFromReportBo(list).sort(); }
private ims.admin.vo.ReportListVoCollection searchReports(String reportName, String templateName) { StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append("select rep from ReportsCategory as cat right join cat.reports as rep left join rep.templates as tpl "); cond.append(andStr + "rep.isActive = :isActive"); markers.add("isActive"); values.add(Boolean.TRUE); andStr = " and "; cond.append(andStr + "UPPER(rep.reportName) like UPPER(:reportName)"); markers.add("reportName"); values.add(reportName); andStr = " and "; cond.append(andStr + "tpl.isActive = :isActive"); markers.add("isActive"); values.add(Boolean.TRUE); andStr = " and "; cond.append(andStr + "UPPER(tpl.name) like UPPER(:templateName)"); markers.add("templateName"); values.add(templateName); andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); DomainFactory factory = getDomainFactory(); List list = factory.find(hql.toString(), markers, values); return ReportListVoAssembler.createReportListVoCollectionFromReportBo(list).sort(); }