DatabaseDao.updateMultiple is redundant with DatabaseDao.update

pull/14/head
Sam Bosley 12 years ago
parent cfe2a0724f
commit f57975b0d8

@ -357,20 +357,6 @@ public class DatabaseDao<TYPE extends AbstractModel> {
return true; return true;
} }
/**
* Updates multiple rows of the database based on model set values
*
* @param item
* item model
* @param criterion
* @return returns true on success.
*/
public int updateMultiple(ContentValues values, Criterion criterion) {
if(values.size() == 0) // nothing changed
return 0;
return database.update(table.name, values, criterion.toString(), null);
}
// --- helper methods // --- helper methods

@ -60,15 +60,6 @@ public final class ActFmDataService {
// --- task and metadata methods // --- task and metadata methods
/**
* Clears metadata information. Used when user logs out of service
*/
public void clearMetadata() {
ContentValues values = new ContentValues();
values.putNull(Task.REMOTE_ID.name);
taskDao.updateMultiple(values, Criterion.all);
}
/** /**
* Currently, this method does nothing, there is an alternate method to create tasks * Currently, this method does nothing, there is an alternate method to create tasks
* @param properties * @param properties

@ -357,9 +357,9 @@ public class TaskService {
* @return # of affected rows * @return # of affected rows
*/ */
public int clearDetails(Criterion criterion) { public int clearDetails(Criterion criterion) {
ContentValues values = new ContentValues(); Task template = new Task();
values.put(Task.DETAILS_DATE.name, 0); template.setValue(Task.DETAILS_DATE, 0L);
return taskDao.updateMultiple(values, criterion); return taskDao.update(criterion, template);
} }
/** /**

Loading…
Cancel
Save