/** * lists order sets by name */ public ims.ocrr.vo.OrderSetShortVoCollection listOrderSets(String name) { if(name == null) return null; DomainFactory factory = getDomainFactory(); java.util.List ordersets = null; ordersets = factory.find("from OrderSet os where upper(os.name) like :name and os.activeStatus = :idActive" , new String[] {"name","idActive"}, new Object[] {"%" + name.toUpperCase() + "%",getDomLookup(PreActiveActiveInactiveStatus.ACTIVE)}); return OrderSetShortVoAssembler.createOrderSetShortVoCollectionFromOrderSet(ordersets); }
/** * listOrderSets */ public ims.ocrr.vo.OrderSetShortVoCollection listOrderSets(ims.ocrr.vo.OrderSetListSearchCriteriaVo searchCriteria) { DomainFactory factory = getDomainFactory(); java.util.List ordeSets = null; String hql = " from OrderSet os "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if(searchCriteria != null) { if(searchCriteria.getNameIsNotNull()) { condStr.append(andStr + " upper(os.name) like :name"); markers.add("name"); values.add("%" + searchCriteria.getName().toUpperCase() + "%"); andStr = " and "; } if(searchCriteria.getStatusIsNotNull()) { condStr.append(andStr + " os.activeStatus = :status"); markers.add("status"); values.add(getDomLookup(searchCriteria.getStatus())); andStr = " and "; } } if(condStr.length() > 0) { hql += " where "; hql += condStr.toString(); } ordeSets = factory.find(hql.toString(), markers, values); return OrderSetShortVoAssembler.createOrderSetShortVoCollectionFromOrderSet(ordeSets); }