public AreaOfNeedsNotingVoCollection listbyCareContext(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = "from AreaofNeedsNoting aon "; ArrayList markers= new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if(voCareContextRef != null) { hql.append(andStr + " aon.clinicalContact.careContext.id = :cc"); markers.add("cc"); values.add(voCareContextRef.getID_CareContext()); } if (markers.size() > 0) query += " where "; query += hql.toString(); java.util.List cttList = factory.find(query,markers,values); AreaOfNeedsNotingVoCollection voAreaOfNeedsNotingColl = AreaOfNeedsNotingVoAssembler.createAreaOfNeedsNotingVoCollectionFromAreaofNeedsNoting(cttList); //if(voAreaOfNeedsNotingColl.size()>0) return voAreaOfNeedsNotingColl; //else //return null; }
public AreaOfNeedsNotingVo save(AreaOfNeedsNotingVo voAreaOfNeedsNoting) throws StaleObjectException { if(!voAreaOfNeedsNoting.isValidated()) throw new DomainRuntimeException("This Area Of Needs record has not been validated"); DomainFactory factory = getDomainFactory(); AreaofNeedsNoting doAreaOfNeeds = AreaOfNeedsNotingVoAssembler.extractAreaofNeedsNoting(factory, voAreaOfNeedsNoting); factory.save(doAreaOfNeeds); return AreaOfNeedsNotingVoAssembler.create(doAreaOfNeeds); }
public AreaOfNeedsNotingVoCollection list(ClinicalContactShortVo voClinicalContact) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = "from AreaofNeedsNoting aon "; ArrayList markers= new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if(voClinicalContact != null) { hql.append(andStr + " aon.clinicalContact.id = :cc"); markers.add("cc"); values.add(voClinicalContact.getID_ClinicalContact()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); java.util.List cttList = factory.find(query,markers,values); AreaOfNeedsNotingVoCollection voAreaOfNeedsNotingColl = AreaOfNeedsNotingVoAssembler.createAreaOfNeedsNotingVoCollectionFromAreaofNeedsNoting(cttList); //if(voAreaOfNeedsNotingColl.size()>0) return voAreaOfNeedsNotingColl; //else //return null; }