public ElectrotherapyPneumaticShortVoCollection listElectrotheraphyPneumaticByCareContext(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from ElectrotherapyPneumatic p "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (voCareContextRef != null) { hql.append(andStr + " p.clinicalContact.careContext.id = :cc"); markers.add("cc"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); List pneumatics = factory.find(query, markers, values, 200); return ElectrotherapyPneumaticShortVoAssembler.createElectrotherapyPneumaticShortVoCollectionFromElectrotherapyPneumatic(pneumatics).sort(); }