@Override public int update(Greeting greeting) { SQLiteDatabase db = databaseHelper.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(Constants.COLUMN_ID, greeting.getId()); contentValues.put(Constants.COLUMN_CONTENT, greeting.getContent()); return db.update( Constants.DATABASE_TABLE_NAME, contentValues, Constants.COLUMN_KEY_ID + " = " + greeting.getId(), null); }
@Override public long insert(Greeting greeting) { SQLiteDatabase db = databaseHelper.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(Constants.COLUMN_ID, greeting.getId()); contentValues.put(Constants.COLUMN_CONTENT, greeting.getContent()); return db.insert(Constants.DATABASE_TABLE_NAME, null, contentValues); }