/** * Domain Interface function used to save a Functional Transfer */ public FunctionalTransfersVo saveFunctionalTransfers(FunctionalTransfersVo functionalTransfers) throws StaleObjectException, UniqueKeyViolationException, ForeignKeyViolationException { // Ensure the value object has been validated if (!functionalTransfers.isValidated()) throw new DomainRuntimeException("FunctionalTransfers record has not been validated"); // Creating a new record if (!functionalTransfers.getID_FunctionalTransfersIsNotNull()) { if (existsRecord(functionalTransfers.getClinicalContact())) throw new ForeignKeyViolationException("A Functional Transfer record already exists for this Clinical Contact"); } DomainFactory factory = getDomainFactory(); FunctionalTransfers domFunctionalTransfers = FunctionalTransfersVoAssembler.extractFunctionalTransfers(factory, functionalTransfers); factory.save(domFunctionalTransfers); return FunctionalTransfersVoAssembler.create(domFunctionalTransfers); }
/** * Domain Interface function used to retrieve a specific Functional Transfer */ public FunctionalTransfersVo getFunctionalTransfers(FunctionalTransfersRefVo functionalTransferRef) { // Check parameter if (functionalTransferRef == null || !functionalTransferRef.getID_FunctionalTransfersIsNotNull()) throw new DomainRuntimeException("Invalid parameter FunctionalTransfer"); return FunctionalTransfersVoAssembler.create((FunctionalTransfers) getDomainFactory().getDomainObject(FunctionalTransfers.class, functionalTransferRef.getID_FunctionalTransfers())); }