public HCGTestsVo getHCGbyCareContext(CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get HCG on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("from HCGTests as hcg where hcg.careContext.id = :careContextID "); List<?> list = factory.find(hql.toString(), new String[] { "careContextID" }, new Object[] { careContextRef.getID_CareContext() }); if (list == null || list.size() == 0) return null; return HCGTestsVoAssembler.create((HCGTests) list.get(0)); }
public HCGTestsVo save(HCGTestsVo hcgToSave) throws StaleObjectException, UniqueKeyViolationException { if (hcgToSave == null) throw new CodingRuntimeException("Cannot save null HCGTest "); if (!hcgToSave.isValidated()) throw new DomainRuntimeException("HCGTest Not Validated."); DomainFactory factory = getDomainFactory(); HCGTests domainHCG = HCGTestsVoAssembler.extractHCGTests(factory, hcgToSave); factory.save(domainHCG); return HCGTestsVoAssembler.create(domainHCG); }
public HCGTestsVo getHCG(HCGTestsRefVo hcgRef) { if (hcgRef == null || hcgRef.getID_HCGTests() == null) { throw new CodingRuntimeException("Cannot get HCGTest on null Id "); } DomainFactory factory = getDomainFactory(); HCGTests domainHCGTest = (HCGTests) factory.getDomainObject(HCGTests.class, hcgRef.getID_HCGTests()); return HCGTestsVoAssembler.create(domainHCGTest); }