예제 #1
0
  /**
   * @param tableMetadata TableMetadata
   * @param DOMeta DOMetaData
   */
  protected static void getColMetadata(
      JConnection conn, JParamObject PO, DictMetadata dictMetadata, DOMetaData DOMeta)
      throws Exception {
    if (DOMeta == null) return;
    TableMetadata tableMetadata = dictMetadata.getTableMetadata();
    if (tableMetadata.colList == null) tableMetadata.colList = new ArrayList();
    EFDataSet efds = DOMeta.getDOColumns();
    //        //获取自列表列与掩码Map
    //        java.util.Map map = getSelfEnumColViewMap(conn, PO, dictMetadata);
    //        //
    for (int i = 0; i < efds.getRowCount(); i++) {
      EFRowSet edrs = efds.getRowSet(i);
      ColumnMetaData colMetadata = ColumnMetaData.getInstance();
      colMetadata.setStubTable(new Hashtable());
      colMetadata.getStubTable().putAll(edrs.getDataMap());
      //			String colid = colMetadata.getString("COL_ID", "");
      String coledit = colMetadata.getString("COL_EDIT", "");
      //            if(map != null && coledit.equals("15")){
      //                String view = (String)map.get(colid);
      //                colMetadata.setString("COL_VIEW", view);
      //            }
      // 从DOMetaData中获取 gengeng 2011-11-21
      if (coledit.equals(ColumnMetaData.EL_SELFENUM))
        colMetadata.setString("COL_VIEW", edrs.getString("SYS_SELFENUM", ""));

      tableMetadata.colList.add(colMetadata);
      //            getColRefDictMetadata(conn, PO, dictMetadata, colMetadata);
    }
  }
예제 #2
0
 /** 使用新式的元数据兼容旧的元数据 */
 protected static DictMetadata getMetaDataNew(JConnection conn, JParamObject PO, String dctid)
     throws Exception {
   DictMetadata dictMetadata = DictMetadata.getInstance();
   dictMetadata.setID(dctid);
   Statement st = null;
   DCTMetaData DICTMeta = null;
   DOMetaData DOMeta = null;
   try {
     st = JConnection.getInstance(conn).createStatement();
     //
     ESPServerContext ctx = ESPServerContext.getInstance(PO, JConnection.getInstance(conn));
     ctx.setStatement(st);
     DICTMeta =
         (DCTMetaData)
             MetaDataManager.getInstance(MetaDataManager._DCTObject_ + "_DAL")
                 .getMetaData(ctx, dctid);
     if (DICTMeta != null) {
       DOMeta = DICTMeta.getDoMetaData();
       dictMetadata.setStubTable(new Hashtable());
       dictMetadata.getStubTable().putAll(DICTMeta.getDataMap());
       //                DICTMeta.getSYS_DCT_CST();
     } else {
       DOMeta =
           (DOMetaData)
               MetaDataManager.getInstance(MetaDataManager._DataObject_ + "_DAL")
                   .getMetaData(ctx, dctid);
     }
     // 对象信息
     TableMetadata tableMetadata = TableMetadata.getInstance();
     tableMetadata.setID(dctid);
     tableMetadata.setStubTable(new Hashtable());
     if (tableMetadata.colList == null) tableMetadata.colList = new ArrayList();
     dictMetadata.tableMetadata = tableMetadata;
     // 复制对象信息
     if (DOMeta != null) tableMetadata.getStubTable().putAll(DOMeta.getDataMap());
     // 复制列信息
     getColMetadata(conn, PO, dictMetadata, DOMeta);
     // 复制数据字典的扩展属性
     getSYS_DCT_CST(conn, PO, dictMetadata, DICTMeta);
   } catch (Exception ex) {
     ex.printStackTrace();
   } finally {
     conn.BackStatement(st, null);
   }
   return dictMetadata;
 }