Code example for SQLiteDatabase

Methods: rawQuery, close

0
  public List<T> executeMulti() {
    SQLiteDatabase db = ORMDroidApplication.getDefaultDatabase();
    try { 
      return executeMulti(db);
    } finally { 
      db.close();
    } 
  } 
   
  /** 
   * Executes the query against the specified database, returning a high performance 
   * cursor instead of the complete in-memory list of objects. 
   */ 
  public Cursor executeMultiForCursor(SQLiteDatabase db) {
    String sql = toSql();
    Log.v(TAG, sql);
    return db.rawQuery(sql, null);
  } 
   
  /** 
   * Execute the query on the specified database, returning all results. 
   */ 
  public List<T> executeMulti(SQLiteDatabase db) {
    String sql = toSql();
    Log.v(TAG, sql);
    return Entity.getEntityMappingEnsureSchema(db, mClass).loadAll(db, db.rawQuery(sql, null));
  } 
}