Package com.exedosoft.plat.gene.jquery

Examples of com.exedosoft.plat.gene.jquery.PropertyManager


      return NO_FORWARD;
    }
   
    DOBO linkBO = DOBO.getDOBOByID(dobouid);
   
    PropertyManager pm = new PropertyManager();
    pm.buildRelation(colName, linkBO);

    return DEFAULT_FORWARD;
  }
View Full Code Here


      return NO_FORWARD;
    }
    DOBOProperty dop = DOBOProperty.getDOBOPropertyByID(propertyInstance.getUid());
    DOBO thisBO = DOBO.getDOBOByID(instance.getUid());
   
    PropertyManager pm = new PropertyManager();
    pm.removeProperty(thisBO, dop);
    return DEFAULT_FORWARD;
  }
View Full Code Here

    String[] key_hiddens = form.getValueArray("checkinstance_hidden");
    String[] dbtypes = form.getValueArray("dbtype");
    String[] dbsizes = form.getValueArray("dbsize");
    String[] colNames = form.getValueArray("col_name");

    PropertyManager pm = new PropertyManager();

    List listSql = new ArrayList();

    List listKeys = new ArrayList();

    if (keys != null && keys.length > 0) {
      listKeys = Arrays.asList(keys);
    }
    List listHiddenKeys = Arrays.asList(key_hiddens);

    DOBO bo = DOBO.getDOBOByName("do_bo");
    DOBO selected = DOBO.getDOBOByID(bo.getCorrInstance().getUid());

    DODataSource dss = null;
    ///多租户情况`
   
    if ("true".equals(DOGlobals.getValue("multi.tenancy"))) {
      dss = DOGlobals.getInstance().getSessoinContext()
          .getTenancyValues().getDataDDS();
    } else {//单租户情况
      dss = selected.getDataBase();
    }
   
   
    Transaction t = dss.getTransaction();
    t.begin();

    // /先确定删除的
    List list = selected.retrieveProperties();
    List propCols = new ArrayList();

    for (Iterator it = list.iterator(); it.hasNext();) {
      DOBOProperty dop = (DOBOProperty) it.next();
      if (dop.getIsPersistence() == null
          || dop.getIsPersistence().intValue() == DOBOProperty.PERSISTENCE_YES) {
        propCols.add(dop.getObjUid());
      }
    }
    List removeCols = new ArrayList(propCols);

    System.out.println("AllCols::" + removeCols);

    removeCols.removeAll(listHiddenKeys);
    // //需要删除的字段propCols

    System.out.println("RemoveCols::" + removeCols);

    for (int i = 0; i < removeCols.size(); i++) {
      String colObjuid = (String) removeCols.get(i);
      DOBOProperty dop = DOBOProperty.getDOBOPropertyByID(colObjuid);

      StringBuffer sb = new StringBuffer("alter table ");
      sb.append(selected.getSqlStr()).append(" drop column ").append(
          dop.getColName());

      listSql.add(sb.toString());

      pm.removeProperty(selected, dop);
    }

    // 先确定新增的

    for (int len = 0; len < key_hiddens.length; len++) {

      String keyHidden = key_hiddens[len];
      if (keyHidden == null || keyHidden.equals("")) {
        if (colNames[len] != null && !colNames[len].equals("")) {
          DOBOProperty dopExists =  DOBOProperty.getDOBOPropertyByName(selected.getName(),
              colNames[len]);
          if (dopExists==null || dopExists.getColName()==null) {

            StringBuffer sb = new StringBuffer("alter table ");
            sb.append(selected.getSqlStr()).append(" add  ")
                .append(colNames[len]).append(" ").append(
                    dbtypes[len]);

            int iDBSize = 255;
            if (dbsizes[len] != null && !dbsizes[len].equals("")) {
              iDBSize = Integer
                  .parseInt(dbsizes[len]);
              sb.append(" (").append(dbsizes[len]).append(")");
            }
            listSql.add(sb.toString());

            int iType = 12;
            try {
              iType = Integer.parseInt(map.get(dbtypes[len]
                  .toLowerCase()));
            } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
            System.out.println("ColName:" + colNames[len]
                + "  DBSize:" + dbsizes[len]);
            pm.addProperty(selected, colNames[len], iType, iDBSize);
           

          }else{
            System.out.println("已经存在ColName::" + DOBOProperty.getDOBOPropertyByName(selected.getName(),
                colNames[len]));
View Full Code Here

    }

   
    DOBO thisBO = DOBO.getDOBOByID(instance.getUid());
   
    PropertyManager pm = new PropertyManager();
    pm.addProperty(thisBO, colName,l10n,Integer.parseInt( type ),Integer.parseInt(dbsize));

    return DEFAULT_FORWARD;
  }
View Full Code Here

TOP

Related Classes of com.exedosoft.plat.gene.jquery.PropertyManager

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.