1. 数据库封装 (db)
2. 控件封装 (widget)
3. ContentProvider和数据库对等封装 (rdb)
4. 网络库封装 (net)
5. 辅助函数 (helper)
6. 其他
-
数据库操作
a. 构造:
select()
from()
where()
limit()
b. 查询
java
result()
get()
c. 操作:
java
update()
insert()
delete()
```
-
数据库构造: 类型:
- DBInt
- DBBool
- DBText
-
用法实例
// 构造sql
Account acc = new Account();
acc.user.set("aaa");
acc.pasw.set("123");
acc.select(acc.pasw).orderBy(acc.user);
acc.toSql(); // sql语句
// 执行查询
Line data = acc.result();
// 插入
Account acc = new Account();
acc.user = "aa";
acc.insert();
// 更新
Account acc = new Account();
acc.user.set("aa");
acc.pasw.set("123");
acc.update(acc.user);
// 定义
public static Account extends Table {
public DBInt id;
public DBText user;
public DBBool pasw;
}
控件封装
df