本文整理汇总了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();
}