コード例 #1
0
 protected void saveCategoriesInTransaction(CategoryTree tree) {
   SQLiteDatabase database = db.db();
   database.beginTransaction();
   try {
     insertInTransaction(tree);
     database.setTransactionSuccessful();
   } finally {
     database.endTransaction();
   }
 }
コード例 #2
0
 public void insertInTransaction(CategoryTree tree) {
   db.db().delete("category", null, null);
   db.reInsertCategory(Category.splitCategory(context));
   db.reInsertCategory(Category.noCategory(context));
   insertInTransaction(tree.getRoot().children);
 }