use of android.arch.persistence.room.Transaction in project bugzy by cpunq.
the class CaseDao method upsertCases.
/**
* It does a partial UPDATE in case the case is already present
* @param cases
*/
@Transaction
public void upsertCases(List<Case> cases) {
long[] ids = insertCases(cases);
int i = 0;
for (long id : ids) {
if (id == -1) {
// cautiously update
Case kase = cases.get(i);
updatePartial(kase.getTitle(), kase.getPriority(), kase.getFixFor(), kase.getProjectName(), kase.getProjectArea(), kase.getStatus(), kase.getPersonAssignedTo(), kase.getPersonOpenedBy(), kase.isFavorite(), kase.getIxBug());
}
i++;
}
}
Aggregations