|
@@ -147,16 +147,18 @@ public class ModelFormService extends AbstractCompService { |
|
|
SwMap col = new SwMap(2); |
|
|
SwMap col = new SwMap(2); |
|
|
final String colName = metaData.getColumnLabel(i).toLowerCase(); |
|
|
final String colName = metaData.getColumnLabel(i).toLowerCase(); |
|
|
col.put("name", colName); |
|
|
col.put("name", colName); |
|
|
SwEnum.DataTypeBean dtb = SwEnum.DataType.getBySqlType(metaData.getColumnType(i), metaData.getPrecision(i), metaData.getScale(i)); |
|
|
|
|
|
col.put("dataType", dtb.value); |
|
|
|
|
|
ModelField field = table.findField(colName); |
|
|
ModelField field = table.findField(colName); |
|
|
if (field != null) { |
|
|
if (field != null) { |
|
|
|
|
|
col.put("dataType", field.getDataType()); |
|
|
col.put("null", field.getNotNull()); |
|
|
col.put("null", field.getNotNull()); |
|
|
col.put("default", field.getDefaultValue()); |
|
|
col.put("default", field.getDefaultValue()); |
|
|
col.put("title", field.getTitle()); |
|
|
col.put("title", field.getTitle()); |
|
|
col.put("link", field.getLink()); |
|
|
col.put("link", field.getLink()); |
|
|
col.put("table", table.getId()); |
|
|
col.put("table", table.getId()); |
|
|
col.put("table_text", table.getTitle()); |
|
|
col.put("table_text", table.getTitle()); |
|
|
|
|
|
} else { |
|
|
|
|
|
SwEnum.DataTypeBean dtb = SwEnum.DataType.getBySqlType(metaData.getColumnType(i), metaData.getPrecision(i), metaData.getScale(i)); |
|
|
|
|
|
col.put("dataType", dtb.value); |
|
|
} |
|
|
} |
|
|
fields.add(col); |
|
|
fields.add(col); |
|
|
} |
|
|
} |
|
|