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); }
protected final boolean executeStatements(SQLiteDatabase db, ArrayList<String> queries) { return PersistUtils.executeStatements(db, queries); }
protected final boolean dropTables(SQLiteDatabase db, String... optionalTableNames) { return PersistUtils.dropTables(db, optionalTableNames); }
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); }