This commit is contained in:
laoyuyu committed 2019-12-23 15:34:33 +08:00
1 parent 0cb5d3e684
commit 27459e7d9a
6 files changed
+19 -12

No files matched your search

@@ -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);
String[] temp = new String[selectionArgs.length];
int i = 0;
for (String arg : selectionArgs) {
temp[i] = SqlUtil.encodeStr(arg);
i++;
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 = db.rawQuery(sql, temp);
} else {
cursor = db.rawQuery(sql, null);
}
Cursor cursor = db.rawQuery(sql, temp);
List<T> data = cursor.getCount() > 0 ? newInstanceEntity(clazz, cursor) : null;
closeCursor(cursor);
return data;
@@ -28,7 +28,6 @@ import java.lang.ref.SoftReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
import java.util.List;
/**