本文整理匯總了Java中de.greenrobot.dao.AbstractDaoMaster類的典型用法代碼示例。如果您正苦於以下問題:Java AbstractDaoMaster類的具體用法?Java AbstractDaoMaster怎麽用?Java AbstractDaoMaster使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AbstractDaoMaster類屬於de.greenrobot.dao包,在下文中一共展示了AbstractDaoMaster類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setUp
import de.greenrobot.dao.AbstractDaoMaster; //導入依賴的package包/類
protected void setUp()
{
super.setUp();
try
{
Constructor constructor = daoMasterClass.getConstructor(new Class[] {
android/database/sqlite/SQLiteDatabase
});
Object aobj[] = new Object[1];
aobj[0] = db;
daoMaster = (AbstractDaoMaster)constructor.newInstance(aobj);
Class class1 = daoMasterClass;
Class aclass[] = new Class[2];
aclass[0] = android/database/sqlite/SQLiteDatabase;
aclass[1] = Boolean.TYPE;
Method method = class1.getMethod("createAllTables", aclass);
Object aobj1[] = new Object[2];
aobj1[0] = db;
aobj1[1] = Boolean.valueOf(false);
method.invoke(null, aobj1);
}
catch (Exception exception)
{
throw new RuntimeException("Could not prepare DAO session test", exception);
}
daoSession = daoMaster.newSession();
}