Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
增加properties
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Apr 25, 2017
1 parent dc9e9ba commit 696c212
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,27 @@ public ResponseMessage fieldList(@PathVariable("name") String name) {
} else {
metaData = table.getMeta();
}
List<Map<String, String>> fieldMeta = metaData.getColumns()
List<Map<String, Object>> fieldMeta = metaData.getColumns()
.stream().sorted().map(fieldMetaData -> {
Map<String, String> data = new HashMap<>();
Map<String, Object> data = new HashMap<>();
data.put("id", fieldMetaData.getAlias());
data.put("text", fieldMetaData.getAlias() + "(" + fieldMetaData.getComment() + ")");
data.put("comment", fieldMetaData.getComment());
data.put("properties", fieldMetaData.getProperties());
return data;
}).collect(Collectors.toList());
//关联表
metaData.getCorrelations().forEach(correlation -> {
RDBTableMetaData metaData1 = metaData.getDatabaseMetaData().getTableMetaData(correlation.getTargetTable());
if (metaData1 == null) return;
metaData1.getColumns().stream().sorted().forEach(m -> {
Map<String, String> data = new HashMap<>();
Map<String, Object> data = new HashMap<>();
data.put("id", correlation.getAlias() + "." + m.getAlias());
data.put("text", correlation.getAlias() + "." + m.getAlias() + "(" + m.getComment() + ")");
String comment = correlation.getComment();
if (comment == null) comment = metaData1.getComment();
data.put("comment", comment + ":" + m.getComment());
data.put("properties", m.getProperties());
fieldMeta.add(data);
});
});
Expand Down

0 comments on commit 696c212

Please sign in to comment.