public ReportTemplateLiteVo getReportTemplateLite(TemplateBoRefVo templateRef) { if (!templateRef.getID_TemplateBoIsNotNull()) throw new DomainRuntimeException("Unable to get Template with null id"); return ReportTemplateLiteVoAssembler.create((TemplateBo) getDomainFactory().getDomainObject(TemplateBo.class, templateRef.getBoId())); }
public ReportTemplateLiteVoCollection getTemplates(ArrayList ids) { if (ids == null) throw new CodingRuntimeException("Mandatory argument - ids"); DomainFactory factory = getDomainFactory(); String hql ="select profile.id from Booking_Appointment as ba left join ba.session as sess left join sess.sch_Profile as profile where ba.id in ( "; for (int i = 0; i < ids.size(); i++) { if (i == 0 || i == ids.size()) hql+=ids.get(0); else hql+=("," + ids.get(i)); } hql += " )"; hql +=" and ba.isRIE is null and sess.isRIE is null and profile.isRIE is null"; String finalHQL = "select pt.template from ProfileTemplate as pt left join pt.template as temp left join pt.profile as prof where prof.id in ( "; finalHQL += hql; finalHQL += " )"; finalHQL +=" and pt.isRIE is null and temp.isRIE is null and prof.isRIE is null"; List lst = factory.find(finalHQL); return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(lst); }
public ReportTemplateLiteVoCollection listReports(String nameFilter) { String hql = "select repTem from ReportBo as rep left join rep.templates as repTem where " + "(rep.isActive = 1 and repTem.isActive = 1 and upper(repTem.name) like :name) order by upper(repTem.name)"; return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo( getDomainFactory().find(hql,"name","%"+(nameFilter == null ? "":nameFilter.toUpperCase())+"%")); }
public ReportTemplateLiteVoCollection getTemplates(ArrayList ids) { if (ids == null) throw new CodingRuntimeException("Mandatory argument - ids"); DomainFactory factory = getDomainFactory(); String hql ="select profile.id from Booking_Appointment as ba left join ba.session as sess left join sess.sch_Profile as profile where ba.id in ( "; for (int i = 0; i < ids.size(); i++) { if (i == 0 || i == ids.size()) hql+=ids.get(0); else hql+=("," + ids.get(i)); } hql += " )"; hql +=" and ba.isRIE is null and sess.isRIE is null and profile.isRIE is null"; String finalHQL = "select pt.template from ProfileTemplate as pt left join pt.template as temp left join temp.report as report join pt.profile as prof where report.isActive =1 and temp.isActive =1 and prof.id in ( "; //WDEV-23494 //WDEV-23731 finalHQL += hql; finalHQL += " )"; finalHQL +=" and pt.isRIE is null and temp.isRIE is null and prof.isRIE is null"; List lst = factory.find(finalHQL); return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(lst); }
public ReportTemplateLiteVoCollection listTemplatesByName(String templateName) throws DomainInterfaceException { if (templateName == null || templateName.length() == 0) throw new DomainInterfaceException("Cannot search on null or zero lenght template name"); //WDEV-17872 String[] names = templateName.split(" "); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = "from TemplateBo tb "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); // Build search criteria for template name { if (markers.size() > 0) hql.append(" AND ("); else hql.append("("); for (int i = 0; i < names.length; i++) { hql.append("upper(tb.name) like :NAME" + i); markers.add("NAME" + i); values.add("%" + names[i].toUpperCase() + "%"); if (i != names.length -1) hql.append(" OR "); } hql.append(")"); } if (markers.size() > 0) query += " where "; query += hql.toString(); try { List<DomainObject> results = factory.find(query, markers, values); ReportTemplateLiteVoCollection templateCollection = ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(results); return templateCollection; } catch (RuntimeException e) { e.printStackTrace(); return null; } }
@SuppressWarnings({ "rawtypes", "unchecked" }) // @Override public ReportTemplateLiteVoCollection listTemplates(String name, Boolean isDft) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append("select t from TemplateBo as t join t.report as rep join rep.seeds as sd"); cond.append(andStr + "t.isActive = :A"); markers.add("A"); values.add(Boolean.TRUE); andStr = " and "; cond.append(andStr + "t.report.isActive = :A"); if(name.length() > 0) { cond.append(andStr + "UPPER(t.name) LIKE UPPER(:NAME)"); markers.add("NAME"); values.add(name); andStr = " and "; } if(isDft) cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderInvestigation.class.getName()}) + ")"); else cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderSpecimen.class.getName(),OrderInvestigation.class.getName()}) + ")"); andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); hql.append(" order by UPPER(t.name)"); List list = factory.find(hql.toString(), markers, values); return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(list); }
@SuppressWarnings({ "rawtypes", "unchecked" }) public ReportTemplateLiteVoCollection listTemplates(String name, Boolean isDft) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append("select t from TemplateBo as t join t.report as rep join rep.seeds as sd"); cond.append(andStr + "t.isActive = :A"); markers.add("A"); values.add(Boolean.TRUE); andStr = " and "; cond.append(andStr + "t.report.isActive = :A"); if(name.length() > 0) { cond.append(andStr + "UPPER(t.name) LIKE UPPER(:NAME)"); markers.add("NAME"); values.add(name); andStr = " and "; } if(isDft) cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderInvestigation.class.getName()}) + ")"); else cond.append(andStr + "sd.bOName in (" + getSeedsString(new String[] {OrderSpecimen.class.getName(),OrderInvestigation.class.getName()}) + ")"); andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); hql.append(" order by UPPER(t.name)"); List list = factory.find(hql.toString(), markers, values); return ReportTemplateLiteVoAssembler.createReportTemplateLiteVoCollectionFromTemplateBo(list); }