Package org.jeecgframework.web.cgform.exception

Examples of org.jeecgframework.web.cgform.exception.BusinessException


      FileOutputStream outputStream = new FileOutputStream(buildFile(parentDir+"/migrateExport.xml", false));
      Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
      writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n");
      xStream.toXML(dbTables, writer);
    } catch (Exception e) {
      throw new BusinessException(e.getMessage());
    }
  }
View Full Code Here


          // 不存在的情况下,创建新表
          try {
            DbTableProcess.createOrDropTable(cgFormHead, getSession());
          } catch (Exception e) {
            logger.error(e.getMessage(),e);
            throw new BusinessException("同步失败:创建新表出错");
          }
        }
        cgFormHead.setIsDbSynch("Y");
        this.saveOrUpdate(cgFormHead)
      }else if(SYN_FORCE.equals(synMethod)){
        //强制方式同步
        try {
          try{
            String sql = getTableUtil().dropTableSQL(cgFormHead.getTableName());
            this.executeSql(sql);
          }catch (Exception e) {
            //部分数据库在没有表而执行删表语句时会报错
            logger.error(e.getMessage());
          }
          DbTableProcess.createOrDropTable(cgFormHead, getSession());
          cgFormHead.setIsDbSynch("Y");
          this.saveOrUpdate(cgFormHead);
        } catch (Exception e) {
          logger.error(e.getMessage(),e);
          throw new BusinessException("同步失败:创建新表出错");
        }
      }
    } catch (Exception e) {
      logger.error(e.getMessage(),e);
      throw new BusinessException("同步失败:数据库不支持本次修改,如果不需要保留数据,请尝试强制同步");
    }
    return true;
  }
View Full Code Here

      if(fkFieldList!=null){
        for(Map<String, Object> fkField:fkFieldList){
          if(mainMap.get((String)fkField.get("main_field"))!=null){
            fieldMap.put((String)fkField.get("field_name"), mainMap.get((String)fkField.get("main_field")));
          }else{
            throw new BusinessException("表单中没有外键:"+(String)fkField.get("main_field"));
          }
        }
      }
        return fieldMap;
    }
View Full Code Here

TOP

Related Classes of org.jeecgframework.web.cgform.exception.BusinessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.