Esempio n. 1
0
 private void executeCreate(SQLiteDatabase db) {
   db.beginTransaction();
   try {
     for (TableInfo tableInfo : Cache.getTableInfos()) {
       db.execSQL(SQLiteUtils.createTableDefinition(tableInfo));
     }
     db.setTransactionSuccessful();
   } finally {
     db.endTransaction();
   }
 }
Esempio n. 2
0
  private void executeCreateIndex(SQLiteDatabase db) {
    db.beginTransaction();
    try {
      for (TableInfo tableInfo : Cache.getTableInfos()) {
        String[] definitions = SQLiteUtils.createIndexDefinition(tableInfo);

        for (String definition : definitions) {
          db.execSQL(definition);
        }
      }
      db.setTransactionSuccessful();
    } finally {
      db.endTransaction();
    }
  }