|
|
|
@ -422,13 +422,19 @@ class DelegateFind extends AbsDelegate { |
|
|
|
|
private <T extends DbEntity> List<T> exeNormalDataSql(SQLiteDatabase db, Class<T> clazz, |
|
|
|
|
String sql, String[] selectionArgs) { |
|
|
|
|
SqlUtil.checkTable(db, clazz); |
|
|
|
|
Cursor cursor; |
|
|
|
|
if (selectionArgs != null) { |
|
|
|
|
|
|
|
|
|
String[] temp = new String[selectionArgs.length]; |
|
|
|
|
int i = 0; |
|
|
|
|
for (String arg : selectionArgs) { |
|
|
|
|
temp[i] = SqlUtil.encodeStr(arg); |
|
|
|
|
i++; |
|
|
|
|
} |
|
|
|
|
Cursor cursor = db.rawQuery(sql, temp); |
|
|
|
|
cursor = db.rawQuery(sql, temp); |
|
|
|
|
} else { |
|
|
|
|
cursor = db.rawQuery(sql, null); |
|
|
|
|
} |
|
|
|
|
List<T> data = cursor.getCount() > 0 ? newInstanceEntity(clazz, cursor) : null; |
|
|
|
|
closeCursor(cursor); |
|
|
|
|
return data; |
|
|
|
|