public HCGTestItemVo saveItem(HCGTestItemVo hcgItemToSave) throws StaleObjectException { if (hcgItemToSave == null) throw new CodingRuntimeException("Cannot save null HCGItem "); if (!hcgItemToSave.isValidated()) throw new DomainRuntimeException("HCGItem Not Validated."); DomainFactory factory = getDomainFactory(); HCGTestItem domainHCGItem = HCGTestItemVoAssembler.extractHCGTestItem(factory, hcgItemToSave); factory.save(domainHCGItem); return HCGTestItemVoAssembler.create(domainHCGItem); }
public HCGTestItemVo getHCGItem(HCGTestItemRefVo hcgItemRef) { if (hcgItemRef == null || hcgItemRef.getID_HCGTestItem() == null) { throw new CodingRuntimeException("Cannot get HCGItem on null Id "); } DomainFactory factory = getDomainFactory(); HCGTestItem domainHCGItem = (HCGTestItem) factory.getDomainObject(HCGTestItem.class, hcgItemRef.getID_HCGTestItem()); return HCGTestItemVoAssembler.create(domainHCGItem); }