de.greenrobot.dao.AbstractDaoMaster Java Examples

The following examples show how to use de.greenrobot.dao.AbstractDaoMaster. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractDaoSessionTest.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
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();
}