Public 成员函数 | |
| AbDBDaoImpl (SQLiteOpenHelper dbHelper, Class< T > clazz) | |
| AbDBDaoImpl (SQLiteOpenHelper dbHelper) | |
| SQLiteOpenHelper | getDbHelper () |
| T | queryOne (int id) |
| List< T > | rawQuery (String sql, String[] selectionArgs, Class< T > clazz) |
| boolean | isExist (String sql, String[] selectionArgs) |
| List< T > | queryList () |
| List< T > | queryList (String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit) |
| List< T > | queryList (String selection, String[] selectionArgs) |
| long | insert (T entity) |
| long | insert (T entity, boolean flag) |
| long[] | insertList (List< T > entityList) |
| long[] | insertList (List< T > entityList, boolean flag) |
| int | delete (int id) |
| int | delete (Integer...ids) |
| int | delete (String whereClause, String[] whereArgs) |
| int | deleteAll () |
| int | update (T entity) |
| int | updateList (List< T > entityList) |
| List< Map< String, String > > | queryMapList (String sql, String[] selectionArgs) |
| int | queryCount (String sql, String[] selectionArgs) |
| void | execSql (String sql, Object[] selectionArgs) |
| void | startWritableDatabase (boolean transaction) |
| void | startReadableDatabase () |
| void | closeDatabase () |
Public 成员函数 继承自 com.ab.db.AbBasicDBDao | |
| String | getStringColumnValue (String columnName, Cursor cursor) |
| int | getIntColumnValue (String columnName, Cursor cursor) |
| void | closeDatabase (Cursor cursor, SQLiteDatabase db) |
| void | closeCursor (Cursor cursor) |
Private 成员函数 | |
| void | getListFromCursor (Class<?> clazz, List< T > list, Cursor cursor) throws IllegalAccessException, InstantiationException |
| String | setContentValues (T entity, ContentValues cv, int type, int method) throws IllegalAccessException |
| String | getLogSql (String sql, Object[] args) |
| void | checkDBOpened () |
Private 属性 | |
| SQLiteOpenHelper | dbHelper |
| final ReentrantLock | lock = new ReentrantLock() |
| String | tableName |
| String | idColumn |
| Class< T > | clazz |
| List< Field > | allFields |
| SQLiteDatabase | db = null |
静态 Private 属性 | |
| static final int | METHOD_INSERT = 0 |
| static final int | METHOD_UPDATE = 1 |
| static final int | TYPE_NOT_INCREMENT = 0 |
| static final int | TYPE_INCREMENT = 1 |
© 2012 amsoft.cn 名称:AbDBDaoImpl.java 描述:数据库表操作类接口实现类
| <T> | the generic type |
|
inline |
用一个对象实体初始化这个数据库操作实现类.
| dbHelper | 数据库操作实现类 |
| clazz | 映射对象实体 |
|
inline |
初始化这个数据库操作实现类.
| dbHelper | 数据库操作实现类 |
|
inlineprivate |
描述:检查DB是否已经打开.
|
inline |
描述:关闭数据库,数据操作后必须调用.
|
inline |
描述:按id删除.
| id | the id |
|
inline |
描述:按id删除.
| ids | the ids |
|
inline |
描述:按条件删除数据.
| whereClause | the where clause |
| whereArgs | the where args |
|
inline |
描述:清空数据.
|
inline |
描述:执行特定的sql.
| sql | the sql |
| selectionArgs | the selection args |
|
inline |
描述:TODO.
|
inlineprivate |
从游标中获得映射对象列表.
| clazz | the clazz |
| list | 返回的映射对象列表 |
| cursor | 当前游标 |
| IllegalAccessException | the illegal access exception |
| InstantiationException | the instantiation exception |
|
inlineprivate |
打印当前sql语句.
| sql | sql语句,带? |
| args | 绑定变量 |
|
inline |
描述:插入实体.
| entity | the entity |
|
inline |
描述:插入实体.
| entity | the entity |
| flag | the flag |
|
inline |
描述:插入列表.
| entityList | the entity list |
|
inline |
描述:插入列表.
| entityList | the entity list |
| flag | the flag |
|
inline |
描述:是否存在.
| sql | the sql |
| selectionArgs | the selection args |
|
inline |
描述:查询数量.
| sql | the sql |
| selectionArgs | the selection args |
|
inline |
|
inline |
描述:查询列表.
| columns | the columns |
| selection | the selection |
| selectionArgs | the selection args |
| groupBy | the group by |
| having | the having |
| orderBy | the order by |
| limit | the limit |
|
inline |
描述:简单一些的查询.
| selection | the selection |
| selectionArgs | the selection args |
|
inline |
描述:查询为map列表.
| sql | the sql |
| selectionArgs | the selection args |
|
inline |
描述:查询一条.
| id | the id |
|
inline |
描述:一种更灵活的方式查询,不支持对象关联,可以写完整的sql.
| sql | 完整的sql如:select * from a ,b where a.id=b.id and a.id = ? |
| selectionArgs | 绑定变量值 |
| clazz | 返回的对象类型 |
|
inlineprivate |
设置这个ContentValues.
| entity | 映射实体 |
| cv | the cv |
| type | id类的类型,是否自增 |
| method | 预执行的操作 |
| IllegalAccessException | the illegal access exception |
|
inline |
描述:获取读数据库,数据操作前必须调用.
|
inline |
描述:获取写数据库,数据操作前必须调用.
| transaction | 是否开启事务 |
|
inline |
描述:更新实体.
| entity | the entity |
|
inline |
描述:更新列表.
| entityList | the entity list |
|
private |
The all fields.
|
private |
The clazz.
|
private |
这个Dao的数据库对象.
|
private |
The db helper.
|
private |
The id column.
|
private |
锁对象.
|
staticprivate |
The Constant METHOD_INSERT.
|
staticprivate |
The Constant METHOD_UPDATE.
|
private |
The table name.
|
staticprivate |
The Constant TYPE_INCREMENT.
|
staticprivate |
The Constant TYPE_NOT_INCREMENT.
1.8.8