public MassageVo getMassageVoByClinicalContact(ClinicalContactRefVo voClinicalContactRef) { if (voClinicalContactRef == null) throw new RuntimeException("Cannot get Massage record for null ClinicalContactRefVo"); StringBuffer query = new StringBuffer("from Massage as m1_1 where m1_1.clinicalContact.id = :CCID order by m1_1.systemInformation.creationDateTime desc"); List list = getDomainFactory().find(query.toString(), "CCID", voClinicalContactRef.getID_ClinicalContact()); if (list == null || list.size() == 0) return null; MassageVoCollection voColl = MassageVoAssembler.createMassageVoCollectionFromMassage(list); if (voColl.size() > 0) return voColl.get(0); return null; }