public InvestigationsVoCollection listInvestigation(CareContextRefVo voCareContextRef) { if (voCareContextRef == null) throw new CodingRuntimeException("Care Context was not supplied. Mandatory argument"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from Investigations t "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append(andStr + " t.careContext.id like :rcc"); markers.add("rcc"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; if (markers.size() > 0) query += " where "; query += hql.toString(); List investList = factory.find(query, markers, values); return InvestigationsVoAssembler.createInvestigationsVoCollectionFromInvestigations(investList); }
public InvestigationsVo saveInvestigationDetails(InvestigationsVo investigations) throws StaleObjectException { if (!investigations.isValidated()) { throw new DomainRuntimeException("Investigation has not been validated"); } DomainFactory factory = getDomainFactory(); Investigations doInvestigation = InvestigationsVoAssembler.extractInvestigations(factory, investigations); factory.save(doInvestigation); return InvestigationsVoAssembler.create(doInvestigation); }
public InvestigationsVo getInvestigation(InvestigationsRefVo investigationId) { if(investigationId == null || !investigationId.getID_InvestigationsIsNotNull()) throw new CodingRuntimeException("Can not get Investigation on null Id."); return InvestigationsVoAssembler.create((Investigations) getDomainFactory().getDomainObject(Investigations.class, investigationId.getID_Investigations())); }