public MobilisationsShortVoCollection listByCareContext(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = "from Mobilisations mob "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Integer> values = new ArrayList<Integer>(); String andStr = " "; if (voCareContextRef != null) { hql.append(andStr + " mob.clinicalContact.careContext.id = :cc"); markers.add("cc"); values.add(voCareContextRef.getID_CareContext()); } if (markers.size() > 0) query += " where "; query += hql.toString(); java.util.List mobilisation = factory.find(query, markers, values); return MobilisationsShortVoAssembler.createMobilisationsShortVoCollectionFromMobilisations(mobilisation); }