public class SQLiteDelegate<T extends EasyDbObject> extends Object implements DataAccesObject<T>
| 限定符和类型 | 字段和说明 |
|---|---|
protected Class<T> |
clazz |
static String |
CREATEDTIME |
static String |
GSONSTRING |
protected android.database.sqlite.SQLiteOpenHelper |
helper |
static String |
ID |
protected String |
tabName |
| 构造器和说明 |
|---|
SQLiteDelegate(android.database.sqlite.SQLiteOpenHelper helper,
String tabName,
Class<T> clazz) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
delete(String id) |
boolean |
deleteAll() |
android.database.Cursor |
findAllCursor(String order) |
ArrayList<T> |
findAllFromTabName(String orderBy) |
ArrayList<T> |
findAllFromTabName(String orderBy,
Type type) |
T |
findById(String id) |
T |
findById(String id,
Type type) |
void |
insert(T dto) |
void |
insertAll(ArrayList<T> arrayList) |
protected final android.database.sqlite.SQLiteOpenHelper helper
protected final String tabName
protected final Class<T extends EasyDbObject> clazz
public void insert(T dto) throws Exception
insert 在接口中 DataAccesObject<T extends EasyDbObject>Exceptionpublic void insertAll(ArrayList<T> arrayList) throws Exception
insertAll 在接口中 DataAccesObject<T extends EasyDbObject>Exceptionpublic T findById(String id, Type type) throws Exception
findById 在接口中 DataAccesObject<T extends EasyDbObject>Exceptionpublic T findById(String id) throws Exception
findById 在接口中 DataAccesObject<T extends EasyDbObject>Exceptionpublic boolean delete(String id) throws Exception
delete 在接口中 DataAccesObject<T extends EasyDbObject>Exceptionpublic boolean deleteAll()
throws Exception
deleteAll 在接口中 DataAccesObject<T extends EasyDbObject>Exceptionpublic ArrayList<T> findAllFromTabName(String orderBy, Type type) throws Exception
findAllFromTabName 在接口中 DataAccesObject<T extends EasyDbObject>Exceptionpublic android.database.Cursor findAllCursor(String order)
findAllCursor 在接口中 DataAccesObject<T extends EasyDbObject>order - eg "_id" DESC 时间正序还是倒序public ArrayList<T> findAllFromTabName(String orderBy) throws Exception
findAllFromTabName 在接口中 DataAccesObject<T extends EasyDbObject>orderBy - eg "_id" DESC 时间正序还是倒序Exception