use of org.greenrobot.greendao.database.Database in project Palm300Heroes by nicolite.
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();
}
use of org.greenrobot.greendao.database.Database in project greenDAO by greenrobot.
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();
}
use of org.greenrobot.greendao.database.Database in project greenDAO by greenrobot.
the class DeleteQuery method executeDeleteWithoutDetachingEntities.
/**
* Deletes all matching entities without detaching them from the identity scope (aka session/cache). Note that this
* method may lead to stale entity objects in the session cache. Stale entities may be returned when loaded by
* their
* primary key, but not using queries.
*/
public void executeDeleteWithoutDetachingEntities() {
checkThread();
Database db = dao.getDatabase();
if (db.isDbLockedByCurrentThread()) {
dao.getDatabase().execSQL(sql, parameters);
} else {
// Do TX to acquire a connection before locking this to avoid deadlocks
// Locking order as described in AbstractDao
db.beginTransaction();
try {
dao.getDatabase().execSQL(sql, parameters);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}
}
use of org.greenrobot.greendao.database.Database in project JustAndroid by chinaltz.
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();
}
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);
}
Aggregations