public void updateCopyIntoOutputChannel(Integer outputChannelTmpId) { AcOutputChannelTmpDetailVo vo = getOutputChannelTmpDetailVoByOutputChannelTmpId(outputChannelTmpId); Integer id = vo.getOutputChannelTmp().getOutputChannelId(); AcOutputChannel e = getAccess().getOutputChannelDb().getOutputChannel(id).getCopy(); vo.getOutputChannelTmp().copyOutputChannelTo(e); getAccess().getOutputChannelDb().update(e); if (e.usesMappings()) getAccess() .getMessageMappingTmpDb() .upsertCopiesIntoMessageMapping(id, vo.getMessageMappings()); else getAccess().getMessageMappingDb().deleteAllByOutputChannelId(id); if (e.usesInclusions()) getAccess() .getInclusionOperatorTmpDb() .upsertCopiesIntoInclusionOperator(id, vo.getInclusionOperator()); else { getAccess().getInclusionOperatorDb().deleteByOutputChannelId(id); getAccess().getInclusionRuleDb().deleteByOutputChannelId(id); } }
public AcOutputChannelTmpDetailVo getOutputChannelTmpDetailVoByOutputChannelTmpId(Integer id) { AcOutputChannelTmp e = getOutputChannelTmp(id); if (e == null) return null; AcOutputChannelTmpDetailVo vo = new AcOutputChannelTmpDetailVo(); vo.setOutputChannelTmp(e); vo.setAccountCode(e.getAccountCode()); vo.setInclusionOperator( getAccess() .getInclusionOperatorTmpDb() .getInclusionOperatorTmpDetailVoByOutputChannelTmpId(id)); vo.addMessageMappings(getAccess().getMessageMappingTmpDb().getMessageMappingTmpDetailVo(id)); return vo; }
public Integer insertCopyIntoOutputChannel(Integer outputChannelTmpId) { AcOutputChannelTmpDetailVo vo = getOutputChannelTmpDetailVoByOutputChannelTmpId(outputChannelTmpId); AcOutputChannel e = getAccess().newOutputChannel(); vo.getOutputChannelTmp().copyOutputChannelTo(e); Integer id = getAccess().getOutputChannelDb().insert(e); if (e.usesMappings()) getAccess() .getMessageMappingTmpDb() .insertCopiesIntoMessageMapping(id, vo.getMessageMappings()); if (e.usesInclusions()) getAccess() .getInclusionOperatorTmpDb() .insertCopiesIntoInclusionOperator(id, vo.getInclusionOperator()); return id; }