Exemplo n.º 1
0
 protected final boolean createTables(
     SQLiteDatabase db, Class<? extends Entity>... entityClasses) {
   ArrayList<String> statements = new ArrayList<String>();
   for (Class<? extends Entity> cls : entityClasses) {
     String query = PersistUtils.getSQLCreate(getTableName(cls), getTableColumnSpecs(cls));
     statements.add(query);
   }
   return executeStatements(db, statements);
 }
Exemplo n.º 2
0
 protected final boolean executeStatements(SQLiteDatabase db, ArrayList<String> queries) {
   return PersistUtils.executeStatements(db, queries);
 }
Exemplo n.º 3
0
 protected final boolean dropTables(SQLiteDatabase db, String... optionalTableNames) {
   return PersistUtils.dropTables(db, optionalTableNames);
 }
Exemplo n.º 4
0
 protected final boolean createIndex(
     SQLiteDatabase db, String table, boolean unique, String firstColumn, String... otherColumns) {
   ArrayList<String> statements = new ArrayList<String>();
   statements.add(PersistUtils.getCreateIndex(table, unique, firstColumn, otherColumns));
   return executeStatements(db, statements);
 }