@SuppressWarnings({"unchecked", "rawtypes"}) public ReportsCategoryLiteVoCollection searchCategoryByName(String categoryName) { StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append("from ReportsCategory as cat "); cond.append(andStr + "UPPER(cat.name) like UPPER(:categoryName)"); markers.add("categoryName"); values.add(categoryName); andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); hql.append(" order by cat.name"); DomainFactory factory = getDomainFactory(); List list = factory.find(hql.toString(), markers, values); return ReportsCategoryLiteVoAssembler.createReportsCategoryLiteVoCollectionFromReportsCategory(list); }
@SuppressWarnings("unchecked") public ReportsCategoryLiteVoCollection searchCategoryByName(String categoryName) { StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append("from ReportsCategory as cat "); cond.append(andStr + "upper(cat.name) like :categoryName"); //wdev-14251 markers.add("categoryName"); values.add(categoryName.toUpperCase()); //wdev-14251 andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); hql.append(" order by cat.name"); DomainFactory factory = getDomainFactory(); List list = factory.find(hql.toString(), markers, values); return ReportsCategoryLiteVoAssembler.createReportsCategoryLiteVoCollectionFromReportsCategory(list); }