Search in sources :

Example 11 with Database

use of org.greenrobot.greendao.database.Database in project greenDAO by greenrobot.

the class EncryptedDatabaseOpenHelperTest method testEncryptedOpenHelper.

public void testEncryptedOpenHelper() {
    createApplication();
    Database db = new OpenHelper(getApplication(), null) {

        @Override
        public void onUpgrade(Database db, int oldVersion, int newVersion) {
        }
    }.getEncryptedReadableDb("password");
    assertDbEncryptedAndFunctional(db);
}
Also used : DevOpenHelper(org.greenrobot.greendao.daotest.DaoMaster.DevOpenHelper) OpenHelper(org.greenrobot.greendao.daotest.DaoMaster.OpenHelper) Database(org.greenrobot.greendao.database.Database)

Example 12 with Database

use of org.greenrobot.greendao.database.Database in project ride-read-android by Ride-Read.

the class DaoMaster method newDevSession.

/**
     * WARNING: Drops all table on Upgrade! Use only during development.
     * Convenience method using a {@link DevOpenHelper}.
     */
public static DaoSession newDevSession(Context context, String name) {
    Database db = new DevOpenHelper(context, name).getWritableDb();
    DaoMaster daoMaster = new DaoMaster(db);
    return daoMaster.newSession();
}
Also used : AbstractDaoMaster(org.greenrobot.greendao.AbstractDaoMaster) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) Database(org.greenrobot.greendao.database.Database) StandardDatabase(org.greenrobot.greendao.database.StandardDatabase)

Example 13 with Database

use of org.greenrobot.greendao.database.Database in project AndroidDevelop by 7449.

the class DaoMaster method newDevSession.

/**
     * WARNING: Drops all table on Upgrade! Use only during development.
     * Convenience method using a {@link DevOpenHelper}.
     */
public static DaoSession newDevSession(Context context, String name) {
    Database db = new DevOpenHelper(context, name).getWritableDb();
    DaoMaster daoMaster = new DaoMaster(db);
    return daoMaster.newSession();
}
Also used : AbstractDaoMaster(org.greenrobot.greendao.AbstractDaoMaster) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) Database(org.greenrobot.greendao.database.Database) StandardDatabase(org.greenrobot.greendao.database.StandardDatabase)

Example 14 with Database

use of org.greenrobot.greendao.database.Database in project AndroidDevelop by 7449.

the class DaoMaster method newDevSession.

/**
     * WARNING: Drops all table on Upgrade! Use only during development.
     * Convenience method using a {@link DevOpenHelper}.
     */
public static DaoSession newDevSession(Context context, String name) {
    Database db = new DevOpenHelper(context, name).getWritableDb();
    DaoMaster daoMaster = new DaoMaster(db);
    return daoMaster.newSession();
}
Also used : AbstractDaoMaster(org.greenrobot.greendao.AbstractDaoMaster) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) Database(org.greenrobot.greendao.database.Database) StandardDatabase(org.greenrobot.greendao.database.StandardDatabase)

Example 15 with Database

use of org.greenrobot.greendao.database.Database in project greenDAO by greenrobot.

the class EncryptedDatabaseOpenHelperTest method testEncryptedDevOpenHelper.

public void testEncryptedDevOpenHelper() {
    createApplication();
    Database db = new DevOpenHelper(getApplication(), null).getEncryptedReadableDb("password");
    assertDbEncryptedAndFunctional(db);
}
Also used : DevOpenHelper(org.greenrobot.greendao.daotest.DaoMaster.DevOpenHelper) Database(org.greenrobot.greendao.database.Database)

Aggregations

Database (org.greenrobot.greendao.database.Database)21 StandardDatabase (org.greenrobot.greendao.database.StandardDatabase)10 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)9 AbstractDaoMaster (org.greenrobot.greendao.AbstractDaoMaster)9 DevOpenHelper (org.greenrobot.greendao.daotest.DaoMaster.DevOpenHelper)2 Cursor (android.database.Cursor)1 SQLiteQueryBuilder (android.database.sqlite.SQLiteQueryBuilder)1 ArrayList (java.util.ArrayList)1 DaoException (org.greenrobot.greendao.DaoException)1 OpenHelper (org.greenrobot.greendao.daotest.DaoMaster.OpenHelper)1 DatabaseStatement (org.greenrobot.greendao.database.DatabaseStatement)1 DevOpenHelper (org.greenrobot.greendao.example.DaoMaster.DevOpenHelper)1 Before (org.junit.Before)1