/** * Save a stretching Record for a Clinical Contact */ public StretchingVo saveStretchingVo(StretchingVo stretching) throws StaleObjectException, ForeignKeyViolationException { // Ensure the value object has been validated if (!stretching.isValidated()) throw new DomainRuntimeException("Stretching has not been validated"); // if a new Stretching record is created check if a Stretching record already exists for this SOAP clinical contact if (stretching != null && stretching.getID_Stretching() == null) { if (existsRecord(stretching.getClinicalContact())) throw new ForeignKeyViolationException("A Stretch record already exists for this SOAP clinical contact"); } DomainFactory factory = getDomainFactory(); Stretching doStretching = StretchingVoAssembler.extractStretching(factory, stretching); factory.save(doStretching); return StretchingVoAssembler.create(doStretching); }
/** * Get the stretching */ public StretchingVo getStretchingVo(StretchingRefVo stretchingRef) { // Check for parameter if (stretchingRef == null || !stretchingRef.getID_StretchingIsNotNull()) throw new DomainRuntimeException("Invalid parameter Stretching Ref"); return StretchingVoAssembler.create((Stretching) getDomainFactory().getDomainObject(Stretching.class, stretchingRef.getID_Stretching())); }