Пример #1
0
 @Override
 public boolean updateMetadataId(String metadataId, String id) {
   String hql = " update " + Ida.class.getName() + " set metadataId = ? where id = ?";
   idaDAOImpl.batchExecute(hql, metadataId, id);
   Ida ida = idaDAOImpl.findUniqueBy("id", id);
   if (ida != null) { // 做一次版本更新
     String interfaceId = ida.getInterfaceId();
     if (org.apache.commons.lang.StringUtils.isNotEmpty(interfaceId)) {
       Interface inter = interfaceDAO.findUniqueBy("interfaceId", interfaceId);
       // 更新版本,只更新一次
       versionServiceImpl.editVersion(inter.getVersionId());
     }
   }
   return true;
 }
Пример #2
0
 public void deletes(String[] ids) {
   boolean editFlag = true;
   for (String id : ids) {
     if (editFlag) {
       Ida ida = idaDAOImpl.findUniqueBy("id", id);
       String interfaceId = ida.getInterfaceId();
       if (org.apache.commons.lang.StringUtils.isNotEmpty(interfaceId)) {
         Interface inter = interfaceDAO.findUniqueBy("interfaceId", interfaceId);
         // 更新版本,只更新一次
         versionServiceImpl.editVersion(inter.getVersionId());
         editFlag = false;
       }
     }
     idaDAOImpl.delete(id);
   }
 }
Пример #3
0
  @Override
  public void saveOrUpdate(Ida[] idas) {
    boolean editFlag = true;
    for (Ida ida : idas) {
      if (StringUtils.isEmpty(ida.getHeadId())) {
        ida.setHeadId(null);
      }
      idaDAOImpl.save(ida);
      if (editFlag) {

        String interfaceId = ida.getInterfaceId();
        if (org.apache.commons.lang.StringUtils.isNotEmpty(interfaceId)) {
          Interface inter = interfaceDAO.findUniqueBy("interfaceId", interfaceId);
          // 更新版本,只更新一次
          versionServiceImpl.editVersion(inter.getVersionId());
          editFlag = false;
        }
      }
    }
  }
Пример #4
0
  public boolean deleteList(List<Ida> list) {
    idaDAOImpl.delete(list);
    boolean editFlag = true;
    for (int i = 0; i < list.size(); i++) {
      if (list.get(i) != null) {
        Ida ida = list.get(i);
        if (ida != null) {
          String interfaceId = ida.getInterfaceId();
          if (org.apache.commons.lang.StringUtils.isNotEmpty(interfaceId)) {
            Interface inter = interfaceDAO.findUniqueBy("interfaceId", interfaceId);
            // 更新版本,只更新一次
            versionServiceImpl.editVersion(inter.getVersionId());
            editFlag = false;
          }
        }
      }
      if (!editFlag) break;
    }

    return true;
  }