2
我一直試圖熟悉GreenDao
Android ORM庫。我一直在跟隨綠色機器人的例子,但已經陷入困境。每當我得到我的一個daos的實例,UserDao
,我沒有任何種類的與dao對象關聯的queryBuilder()
方法。GreenDao:queryBuilder不是實體dao上的方法
import package.DaoMaster;
import package.DaoMaster.DevOpenHelper;
import package.DaoSession;
import package.UserDao;
public class DatabaseHelper {
private SQLiteDatabase db;
private DaoMaster daoMaster;
private DaoSession daoSession;
public DatabaseHelper(Context context) {
DevOpenHelper helper = new DaoMaster.DevOpenHelper(context, "db", null);
this.db = helper.getWritableDatabase();
this.daoMaster = new DaoMaster(db);
this.daoSession = this.daoMaster.newSession();
// attempting to retrieve the queryBuilder instance from a user dao....
// however, no queryBuilder method exists
this.daoSession.getUserDao().queryBuilder();
}
}
我在想什麼?我正在使用greendao-generator
神器,版本號爲1.3.1
。