public SportsActivitySessionShortVoCollection listSportsActivityByCareContext(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); String query = " from SportsActivitySession sas "; StringBuffer hql = new StringBuffer(); String andStr = " "; ArrayList markers= new ArrayList(); ArrayList values = new ArrayList(); if(voCareContextRef != null) { hql.append(andStr + " sas.clinicalContact.careContext.id = :cc"); markers.add("cc"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); java.util.List sasList = factory.find(query,markers,values); SportsActivitySessionShortVoCollection voSportsActivitySessionColl = SportsActivitySessionShortVoAssembler.createSportsActivitySessionShortVoCollectionFromSportsActivitySession(sasList); //if(voSportsActivitySessionColl != null && voSportsActivitySessionColl.size()>0) return voSportsActivitySessionColl; //else // return null; }