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