public AdaptationsVoCollection listByCareContext(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = "from Adaptations ad "; ArrayList markers= new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if(voCareContextRef != null) { hql.append(andStr + " ad.careContext.id = :cc"); markers.add("cc"); values.add(voCareContextRef.getID_CareContext()); } if (markers.size() > 0) query += " where "; query += hql.toString(); java.util.List Adaptations = factory.find(query,markers,values); AdaptationsVoCollection voAdaptationsColl = AdaptationsVoAssembler.createAdaptationsVoCollectionFromAdaptations(Adaptations); return voAdaptationsColl; }