Search in sources :

Example 1 with SqlArguments

use of org.adw.launcher2.LauncherProvider.SqlArguments in project ADWLauncher2 by boombuler.

the class AppDBProvider method insert.

@Override
public Uri insert(Uri uri, ContentValues initialValues) {
    SqlArguments args = new SqlArguments(uri);
    SQLiteDatabase db = mOpenHelper.getWritableDatabase();
    final long rowId = db.insert(args.table, null, initialValues);
    if (rowId <= 0)
        return null;
    return ContentUris.withAppendedId(uri, rowId);
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase) SqlArguments(org.adw.launcher2.LauncherProvider.SqlArguments)

Example 2 with SqlArguments

use of org.adw.launcher2.LauncherProvider.SqlArguments in project ADWLauncher2 by boombuler.

the class AppDBProvider method update.

@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
    SqlArguments args = new SqlArguments(uri, selection, selectionArgs);
    SQLiteDatabase db = mOpenHelper.getWritableDatabase();
    return db.update(args.table, values, args.where, args.args);
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase) SqlArguments(org.adw.launcher2.LauncherProvider.SqlArguments)

Example 3 with SqlArguments

use of org.adw.launcher2.LauncherProvider.SqlArguments in project ADWLauncher2 by boombuler.

the class AppDBProvider method delete.

@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
    SqlArguments args = new SqlArguments(uri, selection, selectionArgs);
    SQLiteDatabase db = mOpenHelper.getWritableDatabase();
    return db.delete(args.table, args.where, args.args);
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase) SqlArguments(org.adw.launcher2.LauncherProvider.SqlArguments)

Example 4 with SqlArguments

use of org.adw.launcher2.LauncherProvider.SqlArguments in project ADWLauncher2 by boombuler.

the class AppDBProvider method bulkInsert.

@Override
public int bulkInsert(Uri uri, ContentValues[] values) {
    SqlArguments args = new SqlArguments(uri);
    SQLiteDatabase db = mOpenHelper.getWritableDatabase();
    try {
        db.beginTransaction();
        DoBulkInsert(db, args.table, values);
        db.setTransactionSuccessful();
    } finally {
        db.endTransaction();
        db.close();
    }
    return values.length;
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase) SqlArguments(org.adw.launcher2.LauncherProvider.SqlArguments)

Aggregations

SQLiteDatabase (android.database.sqlite.SQLiteDatabase)4 SqlArguments (org.adw.launcher2.LauncherProvider.SqlArguments)4