/** * 返回cgForm中列的描述信息 * * @param table * @return */ public static Map<String, ColumnMeta> getColumnMetadataFormCgForm(CgFormHeadEntity table) { Map<String, ColumnMeta> map = new HashMap<String, ColumnMeta>(); List<CgFormFieldEntity> cgFormFieldEntities = table.getColumns(); ColumnMeta columnMeta; for (CgFormFieldEntity cgFormFieldEntity : cgFormFieldEntities) { columnMeta = new ColumnMeta(); columnMeta.setTableName(table.getTableName().toLowerCase()); columnMeta.setColumnId(cgFormFieldEntity.getId()); columnMeta.setColumnName(cgFormFieldEntity.getFieldName().toLowerCase()); columnMeta.setColumnSize(cgFormFieldEntity.getLength()); columnMeta.setColunmType(cgFormFieldEntity.getType().toLowerCase()); columnMeta.setIsNullable(cgFormFieldEntity.getIsNull()); columnMeta.setComment(cgFormFieldEntity.getContent()); columnMeta.setDecimalDigits(cgFormFieldEntity.getPointLength()); columnMeta.setFieldDefault(judgeIsNumber(cgFormFieldEntity.getFieldDefault())); columnMeta.setPkType(table.getJformPkType() == null ? "UUID" : table.getJformPkType()); columnMeta.setOldColumnName( cgFormFieldEntity.getOldFieldName() != null ? cgFormFieldEntity.getOldFieldName().toLowerCase() : null); logger.info( "getColumnMetadataFormCgForm ---->COLUMN_NAME:" + cgFormFieldEntity.getFieldName().toLowerCase() + " TYPE_NAME:" + cgFormFieldEntity.getType().toLowerCase() + " DECIMAL_DIGITS:" + cgFormFieldEntity.getPointLength() + " COLUMN_SIZE:" + cgFormFieldEntity.getLength()); map.put(cgFormFieldEntity.getFieldName().toLowerCase(), columnMeta); } return map; }
/** * 返回cgForm中列名的新和旧的对应关系 * * @param table * @return */ public static Map<String, String> getNewAndOldFieldName(CgFormHeadEntity table) { Map<String, String> map = new HashMap<String, String>(); List<CgFormFieldEntity> cgFormFieldEntities = table.getColumns(); for (CgFormFieldEntity cgFormFieldEntity : cgFormFieldEntities) { map.put(cgFormFieldEntity.getFieldName(), cgFormFieldEntity.getOldFieldName()); } return map; }