|
|
|
@ -38,6 +38,10 @@ public class ResetDataServiceImpl implements ResetDataService, InitializingBean |
|
|
|
|
private Path path; |
|
|
|
|
|
|
|
|
|
private static final String TABLE_STRING = "table"; |
|
|
|
|
private static final String SCHEMA_STRING = "schema"; |
|
|
|
|
private static final String DATA_STRING = "data"; |
|
|
|
|
private static final String COLUMN_STRING = "columns"; |
|
|
|
|
private static final String TABLE_TEXT_STRING = "table_text"; |
|
|
|
|
private static final String NAME_STRING = "name"; |
|
|
|
|
private static final String DATA_TYPE_STRING = "data_type"; |
|
|
|
|
private static final String LENGTH_STRING = "length"; |
|
|
|
@ -63,15 +67,15 @@ public class ResetDataServiceImpl implements ResetDataService, InitializingBean |
|
|
|
|
JSONArray jo = new JSONArray(result); |
|
|
|
|
for (int i=0; i<jo.length(); i++){ |
|
|
|
|
JSONObject schema = jo.getJSONObject(i); |
|
|
|
|
String schemaName = schema.getString("schema"); |
|
|
|
|
JSONArray data = schema.getJSONArray("data"); |
|
|
|
|
String schemaName = schema.getString(SCHEMA_STRING); |
|
|
|
|
JSONArray data = schema.getJSONArray(DATA_STRING); |
|
|
|
|
|
|
|
|
|
for (int ia = 0; ia<data.length(); ia++){ |
|
|
|
|
JSONObject apra = data.getJSONObject(ia); |
|
|
|
|
String tableText; |
|
|
|
|
String tableName; |
|
|
|
|
if(apra.has("table_text")){ |
|
|
|
|
tableText = apra.getString("table_text"); |
|
|
|
|
if(apra.has(TABLE_TEXT_STRING)){ |
|
|
|
|
tableText = apra.getString(TABLE_TEXT_STRING); |
|
|
|
|
} else { |
|
|
|
|
tableText = ""; |
|
|
|
|
} |
|
|
|
@ -81,7 +85,7 @@ public class ResetDataServiceImpl implements ResetDataService, InitializingBean |
|
|
|
|
tableName = ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONArray col = apra.getJSONArray("columns"); |
|
|
|
|
JSONArray col = apra.getJSONArray(COLUMN_STRING); |
|
|
|
|
InfoTable infoTable = new InfoTable(); |
|
|
|
|
infoTable.setNameTable(tableName); |
|
|
|
|
infoTable.setNameSchema(schemaName); |
|
|
|
@ -138,8 +142,8 @@ public class ResetDataServiceImpl implements ResetDataService, InitializingBean |
|
|
|
|
JSONArray jo = new JSONArray(result); |
|
|
|
|
for (int i=0; i<jo.length(); i++){ |
|
|
|
|
JSONObject schema = jo.getJSONObject(i); |
|
|
|
|
String schemaName = schema.getString("schema"); |
|
|
|
|
JSONArray data = schema.getJSONArray("data"); |
|
|
|
|
String schemaName = schema.getString(SCHEMA_STRING); |
|
|
|
|
JSONArray data = schema.getJSONArray(DATA_STRING); |
|
|
|
|
|
|
|
|
|
for (int ia = 0; ia<data.length(); ia++){ |
|
|
|
|
JSONObject apra = data.getJSONObject(ia); |
|
|
|
@ -149,7 +153,7 @@ public class ResetDataServiceImpl implements ResetDataService, InitializingBean |
|
|
|
|
} else { |
|
|
|
|
tableName = ""; |
|
|
|
|
} |
|
|
|
|
JSONArray col = apra.getJSONArray("columns"); |
|
|
|
|
JSONArray col = apra.getJSONArray(COLUMN_STRING); |
|
|
|
|
|
|
|
|
|
for (int ib =0; ib<col.length(); ib++){ |
|
|
|
|
JSONObject colData = col.getJSONObject(ib); |
|
|
|
|