Exemplo n.º 1
0
  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);
    }
  }
Exemplo n.º 2
0
  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;
  }