Search in sources :

Example 1 with DatabaseCompartment

use of nl.qbusict.cupboard.DatabaseCompartment in project philm by chrisbanes.

the class PhilmSQLiteOpenHelper method delete.

@Override
public void delete(Collection<PhilmMovie> movies) {
    assetNotClosed();
    SQLiteDatabase db = null;
    try {
        db = getWritableDatabase();
        db.beginTransaction();
        final DatabaseCompartment dbc = cupboard().withDatabase(db);
        for (PhilmMovie movie : movies) {
            dbc.delete(movie);
        }
        db.setTransactionSuccessful();
    } catch (Exception e) {
    // Crashlytics.logException(e);
    } finally {
        if (db != null) {
            db.endTransaction();
        }
    }
}
Also used : PhilmMovie(app.philm.in.model.PhilmMovie) DatabaseCompartment(nl.qbusict.cupboard.DatabaseCompartment) SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Aggregations

SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 PhilmMovie (app.philm.in.model.PhilmMovie)1 DatabaseCompartment (nl.qbusict.cupboard.DatabaseCompartment)1