|
|
|
@ -38,10 +38,6 @@ 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"; |
|
|
|
@ -67,15 +63,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_STRING); |
|
|
|
|
JSONArray data = schema.getJSONArray(DATA_STRING); |
|
|
|
|
String schemaName = schema.getString("schema"); |
|
|
|
|
JSONArray data = schema.getJSONArray("data"); |
|
|
|
|
|
|
|
|
|
for (int ia = 0; ia<data.length(); ia++){ |
|
|
|
|
JSONObject apra = data.getJSONObject(ia); |
|
|
|
|
String tableText; |
|
|
|
|
String tableName; |
|
|
|
|
if(apra.has(TABLE_TEXT_STRING)){ |
|
|
|
|
tableText = apra.getString(TABLE_TEXT_STRING); |
|
|
|
|
if(apra.has("table_text")){ |
|
|
|
|
tableText = apra.getString("table_text"); |
|
|
|
|
} else { |
|
|
|
|
tableText = ""; |
|
|
|
|
} |
|
|
|
@ -85,7 +81,7 @@ public class ResetDataServiceImpl implements ResetDataService, InitializingBean |
|
|
|
|
tableName = ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONArray col = apra.getJSONArray(COLUMN_STRING); |
|
|
|
|
JSONArray col = apra.getJSONArray("columns"); |
|
|
|
|
InfoTable infoTable = new InfoTable(); |
|
|
|
|
infoTable.setNameTable(tableName); |
|
|
|
|
infoTable.setNameSchema(schemaName); |
|
|
|
@ -142,8 +138,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_STRING); |
|
|
|
|
JSONArray data = schema.getJSONArray(DATA_STRING); |
|
|
|
|
String schemaName = schema.getString("schema"); |
|
|
|
|
JSONArray data = schema.getJSONArray("data"); |
|
|
|
|
|
|
|
|
|
for (int ia = 0; ia<data.length(); ia++){ |
|
|
|
|
JSONObject apra = data.getJSONObject(ia); |
|
|
|
@ -153,7 +149,7 @@ public class ResetDataServiceImpl implements ResetDataService, InitializingBean |
|
|
|
|
} else { |
|
|
|
|
tableName = ""; |
|
|
|
|
} |
|
|
|
|
JSONArray col = apra.getJSONArray(COLUMN_STRING); |
|
|
|
|
JSONArray col = apra.getJSONArray("columns"); |
|
|
|
|
|
|
|
|
|
for (int ib =0; ib<col.length(); ib++){ |
|
|
|
|
JSONObject colData = col.getJSONObject(ib); |
|
|
|
|