|
5 | 5 |
|
6 | 6 | package apijson.orm; |
7 | 7 |
|
8 | | -import static apijson.JSONObject.KEY_CACHE; |
9 | | -import static apijson.JSONObject.KEY_CAST; |
10 | | -import static apijson.JSONObject.KEY_COLUMN; |
11 | | -import static apijson.JSONObject.KEY_COMBINE; |
12 | | -import static apijson.JSONObject.KEY_DATABASE; |
13 | | -import static apijson.JSONObject.KEY_DATASOURCE; |
14 | | -import static apijson.JSONObject.KEY_EXPLAIN; |
15 | | -import static apijson.JSONObject.KEY_FROM; |
16 | | -import static apijson.JSONObject.KEY_GROUP; |
17 | | -import static apijson.JSONObject.KEY_HAVING; |
18 | | -import static apijson.JSONObject.KEY_HAVING_AND; |
19 | | -import static apijson.JSONObject.KEY_ID; |
20 | | -import static apijson.JSONObject.KEY_JSON; |
21 | | -import static apijson.JSONObject.KEY_NULL; |
22 | | -import static apijson.JSONObject.KEY_ORDER; |
23 | | -import static apijson.JSONObject.KEY_RAW; |
24 | | -import static apijson.JSONObject.KEY_ROLE; |
25 | | -import static apijson.JSONObject.KEY_SCHEMA; |
26 | | -import static apijson.JSONObject.KEY_USER_ID; |
27 | | -import static apijson.RequestMethod.DELETE; |
28 | | -import static apijson.RequestMethod.GET; |
29 | | -import static apijson.RequestMethod.GETS; |
30 | | -import static apijson.RequestMethod.HEADS; |
31 | | -import static apijson.RequestMethod.POST; |
32 | | -import static apijson.RequestMethod.PUT; |
33 | | -import static apijson.SQL.AND; |
34 | | -import static apijson.SQL.NOT; |
35 | | -import static apijson.SQL.ON; |
36 | | -import static apijson.SQL.OR; |
| 8 | +import com.alibaba.fastjson.JSONArray; |
| 9 | +import com.alibaba.fastjson.JSONObject; |
| 10 | +import com.alibaba.fastjson.annotation.JSONField; |
37 | 11 |
|
38 | 12 | import java.util.ArrayList; |
39 | 13 | import java.util.Arrays; |
|
48 | 22 |
|
49 | 23 | import javax.activation.UnsupportedDataTypeException; |
50 | 24 |
|
51 | | -import com.alibaba.fastjson.JSONArray; |
52 | | -import com.alibaba.fastjson.JSONObject; |
53 | | -import com.alibaba.fastjson.annotation.JSONField; |
54 | | - |
55 | 25 | import apijson.JSON; |
56 | 26 | import apijson.JSONResponse; |
57 | 27 | import apijson.Log; |
|
62 | 32 | import apijson.orm.Join.On; |
63 | 33 | import apijson.orm.exception.NotExistException; |
64 | 34 | import apijson.orm.model.Access; |
| 35 | +import apijson.orm.model.AllColumn; |
| 36 | +import apijson.orm.model.AllColumnComment; |
| 37 | +import apijson.orm.model.AllTable; |
| 38 | +import apijson.orm.model.AllTableComment; |
65 | 39 | import apijson.orm.model.Column; |
66 | | -import apijson.orm.model.DbaColumn; |
67 | | -import apijson.orm.model.DbaTable; |
68 | 40 | import apijson.orm.model.Document; |
69 | 41 | import apijson.orm.model.ExtendedProperty; |
70 | 42 | import apijson.orm.model.Function; |
|
76 | 48 | import apijson.orm.model.Table; |
77 | 49 | import apijson.orm.model.TestRecord; |
78 | 50 |
|
| 51 | +import static apijson.JSONObject.KEY_CACHE; |
| 52 | +import static apijson.JSONObject.KEY_CAST; |
| 53 | +import static apijson.JSONObject.KEY_COLUMN; |
| 54 | +import static apijson.JSONObject.KEY_COMBINE; |
| 55 | +import static apijson.JSONObject.KEY_DATABASE; |
| 56 | +import static apijson.JSONObject.KEY_DATASOURCE; |
| 57 | +import static apijson.JSONObject.KEY_EXPLAIN; |
| 58 | +import static apijson.JSONObject.KEY_FROM; |
| 59 | +import static apijson.JSONObject.KEY_GROUP; |
| 60 | +import static apijson.JSONObject.KEY_HAVING; |
| 61 | +import static apijson.JSONObject.KEY_HAVING_AND; |
| 62 | +import static apijson.JSONObject.KEY_ID; |
| 63 | +import static apijson.JSONObject.KEY_JSON; |
| 64 | +import static apijson.JSONObject.KEY_NULL; |
| 65 | +import static apijson.JSONObject.KEY_ORDER; |
| 66 | +import static apijson.JSONObject.KEY_RAW; |
| 67 | +import static apijson.JSONObject.KEY_ROLE; |
| 68 | +import static apijson.JSONObject.KEY_SCHEMA; |
| 69 | +import static apijson.JSONObject.KEY_USER_ID; |
| 70 | +import static apijson.RequestMethod.DELETE; |
| 71 | +import static apijson.RequestMethod.GET; |
| 72 | +import static apijson.RequestMethod.GETS; |
| 73 | +import static apijson.RequestMethod.HEADS; |
| 74 | +import static apijson.RequestMethod.POST; |
| 75 | +import static apijson.RequestMethod.PUT; |
| 76 | +import static apijson.SQL.AND; |
| 77 | +import static apijson.SQL.NOT; |
| 78 | +import static apijson.SQL.ON; |
| 79 | +import static apijson.SQL.OR; |
| 80 | + |
79 | 81 | /**config sql for JSON Request |
80 | 82 | * @author Lemon |
81 | 83 | */ |
@@ -133,8 +135,10 @@ public abstract class AbstractSQLConfig implements SQLConfig { |
133 | 135 | TABLE_KEY_MAP.put(SysTable.class.getSimpleName(), SysTable.TABLE_NAME); |
134 | 136 | TABLE_KEY_MAP.put(SysColumn.class.getSimpleName(), SysColumn.TABLE_NAME); |
135 | 137 | TABLE_KEY_MAP.put(ExtendedProperty.class.getSimpleName(), ExtendedProperty.TABLE_NAME); |
136 | | - TABLE_KEY_MAP.put(DbaTable.class.getSimpleName(), DbaTable.TABLE_NAME); |
137 | | - TABLE_KEY_MAP.put(DbaColumn.class.getSimpleName(), DbaColumn.TABLE_NAME); |
| 138 | + TABLE_KEY_MAP.put(AllTable.class.getSimpleName(), AllTable.TABLE_NAME); |
| 139 | + TABLE_KEY_MAP.put(AllColumn.class.getSimpleName(), AllColumn.TABLE_NAME); |
| 140 | + TABLE_KEY_MAP.put(AllTableComment.class.getSimpleName(), AllTableComment.TABLE_NAME); |
| 141 | + TABLE_KEY_MAP.put(AllColumnComment.class.getSimpleName(), AllColumnComment.TABLE_NAME); |
138 | 142 |
|
139 | 143 | CONFIG_TABLE_LIST = new ArrayList<>(); // Table, Column 等是系统表 AbstractVerifier.SYSTEM_ACCESS_MAP.keySet()); |
140 | 144 | CONFIG_TABLE_LIST.add(Function.class.getSimpleName()); |
@@ -1042,8 +1046,8 @@ public String getSQLSchema() { |
1042 | 1046 | if (SysTable.TAG.equals(table) || SysColumn.TAG.equals(table) || ExtendedProperty.TAG.equals(table)) { |
1043 | 1047 | return SCHEMA_SYS; //SQL Server 在 sys 中的属性比 information_schema 中的要全,能拿到注释 |
1044 | 1048 | } |
1045 | | - if (DbaTable.TAG.equals(table) || DbaColumn.TAG.equals(table)) { |
1046 | | - return ""; //Oracle, Dameng 的 dba_tables 和 all_tab_columns 表好像不属于任何 Schema |
| 1049 | + if (AllTable.TAG.equals(table) || AllColumn.TAG.equals(table) || AllTableComment.TAG.equals(table) || AllTableComment.TAG.equals(table)) { |
| 1050 | + return ""; //Oracle, Dameng 的 all_tables, dba_tables 和 all_tab_columns, dba_columns 表好像不属于任何 Schema |
1047 | 1051 | } |
1048 | 1052 |
|
1049 | 1053 | String sch = getSchema(); |
|
0 commit comments