Search in sources :

Example 1 with Transaction

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++;
    }
}
Also used : Case(com.bluestacks.bugzy.data.model.Case) Transaction(android.arch.persistence.room.Transaction)

Aggregations

Transaction (android.arch.persistence.room.Transaction)1 Case (com.bluestacks.bugzy.data.model.Case)1