/** * 创建列 * * @param id String * @param mc String * @param type String * @param len int * @param edittype int * @param view String * @return ColumnMetaData */ public static ColumnMetaData CreateColumnMetadata( String id, String mc, String type, int len, int edittype, String view) { ColumnMetaData meta = new ColumnMetaData(null); meta.setString("COL_ID", id); meta.setString("COL_MC", mc); meta.setInt("COL_LEN", len); meta.setString("COL_TYPE", type); meta.setString("COL_EDIT", String.valueOf(edittype)); if (view != null) meta.setString("COL_VIEW", view); return meta; }
/** * @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); } }
public static ColumnMetaData CreateColMetadata( String id, String mc, int displen, int edittype, String view) { ColumnMetaData col = ColumnMetaData.getInstance(); col.setString("COL_ID", id); col.setString("COL_MC", mc); col.setString("COL_PREC", String.valueOf(displen)); col.setString("COL_USE", "1"); String type = "C"; if (edittype == ColumnMetaData.EL_DATE) type = "D"; if (edittype == ColumnMetaData.EL_INT) type = "I"; if (edittype == ColumnMetaData.EL_FLOAT) type = "N"; col.setString("COL_TYPE", type); col.setString("COL_EDIT", String.valueOf(edittype)); if (view != null) col.setString("COL_VIEW", view); return col; }