private ContentValues getContentValues(Pursuit pursuit) { ContentValues pursuitValues = new ContentValues(); if (pursuit.getName() != null) pursuitValues.put(DatabaseHelper.COLUMN_PURSUIT_NAME, pursuit.getName()); if (pursuit.getStatedType() != null) pursuitValues.put(DatabaseHelper.COLUMN_PURSUIT_TYPE, pursuit.getStatedType().getIntCode()); if (pursuit.getIdealScore() != null) pursuitValues.put(DatabaseHelper.COLUMN_IDEAL_SCORE, pursuit.getIdealScore().getId()); return pursuitValues; }
public void deletePursuit(Pursuit pursuit) { long pursuitId = pursuit.getId(); scoreDAO.deleteScore(pursuit.getIdealScore()); /*long idealScoreId = pursuit.getIdealScore().getId();*/ Log.d(this.getClass().getSimpleName(), "Deleting task Id: " + pursuitId); database.delete( DatabaseHelper.PURSUIT_TABLE, DatabaseHelper.COLUMN_PURSUIT_ID_PK + " = " + pursuitId, null); }