Skip to content
Permalink
Browse files

Fix select query error

  • Loading branch information...
amitshekhariitbhu committed Mar 7, 2019
1 parent bae78e9 commit c227bcca0962e562fa857e3fc1317ebeaff3ed01
Showing with 19 additions and 0 deletions.
  1. +19 −0 debug-db-base/src/main/java/com/amitshekhar/utils/DatabaseHelper.java
@@ -124,6 +124,25 @@ public static TableDataResponse getTableData(SQLiteDB db, String selectQuery, St

tableData.isSuccessful = true;
tableData.rows = new ArrayList<>();

String[] columnNames = cursor.getColumnNames();

List<TableDataResponse.TableInfo> tableInfoListModified = new ArrayList<>();

for (String columnName : columnNames) {
for (TableDataResponse.TableInfo tableInfo : tableData.tableInfos) {
if (columnName.equals(tableInfo.title)) {
tableInfoListModified.add(tableInfo);
break;
}
}
}

if (tableData.tableInfos.size() != tableInfoListModified.size()) {
tableData.tableInfos = tableInfoListModified;
tableData.isEditable = false;
}

if (cursor.getCount() > 0) {

do {

0 comments on commit c227bcc

Please sign in to comment.
You can’t perform that action at this time.