/** * Executes the query and returns the result as a list that lazy loads the entities on every access (uncached). * Make sure to close the list to close the underlying cursor. */ public LazyList<T> listLazyUncached() { checkThread(); Cursor cursor = dao.getDatabase().rawQuery(sql, parameters); return new LazyList<T>(daoAccess, cursor, false); }
/** * Executes the query and returns the unique result or null. * * @return Entity or null if no matching entity was found * @throws DaoException if the result is not unique */ public T unique() { checkThread(); Cursor cursor = dao.getDatabase().rawQuery(sql, parameters); return daoAccess.loadUniqueAndCloseCursor(cursor); }
/** * Executes the query and returns the result as a list that lazy loads the entities on first access. Entities are * cached, so accessing the same entity more than once will not result in loading an entity from the underlying * cursor again.Make sure to close it to close the underlying cursor. */ public LazyList<T> listLazy() { checkThread(); Cursor cursor = dao.getDatabase().rawQuery(sql, parameters); return new LazyList<T>(daoAccess, cursor, true); }
/** Executes the query and returns the result as a list containing all entities loaded into memory. */ public List<T> list() { checkThread(); Cursor cursor = dao.getDatabase().rawQuery(sql, parameters); return daoAccess.loadAllAndCloseCursor(cursor); }
/** Executes the query and returns the result as a list containing all entities loaded into memory. */ public List<T> list() { checkThread(); Cursor cursor = dao.getDatabase().rawQuery(sql, parameters); return daoAccess.loadAllAndCloseCursor(cursor); }
/** * Executes the query and returns the result as a list that lazy loads the entities on every access (uncached). * Make sure to close the list to close the underlying cursor. */ public LazyList<T> listLazyUncached() { checkThread(); Cursor cursor = dao.getDatabase().rawQuery(sql, parameters); return new LazyList<T>(daoAccess, cursor, false); }
/** * Executes the query and returns the result as a list that lazy loads the entities on first access. Entities are * cached, so accessing the same entity more than once will not result in loading an entity from the underlying * cursor again.Make sure to close it to close the underlying cursor. */ public LazyList<T> listLazy() { checkThread(); Cursor cursor = dao.getDatabase().rawQuery(sql, parameters); return new LazyList<T>(daoAccess, cursor, true); }
/** * Executes the query and returns the unique result or null. * * @return Entity or null if no matching entity was found * @throws DaoException if the result is not unique */ public T unique() { checkThread(); Cursor cursor = dao.getDatabase().rawQuery(sql, parameters); return daoAccess.loadUniqueAndCloseCursor(cursor); }