title: Room DAO Cursor replacement
body: <p>Currently I am refactoring a bit old project and decided to use Room DAO. This project uses Cursor to display a long list of entities. Ok Room DAO has an abilility to return Cursor. </p>
  
  <pre><code>@Query("SELECT * FROM user")
  public Cursor loadUsers();
  </code></pre>
  
  <p>But the official documentation discourage us to use it </p>
  
  <blockquote>
    <p>Caution: It's highly discouraged to work with the Cursor API because
    it doesn't guarantee whether the rows exist or what values the rows
    contain. Use this functionality only if you already have code that
    expects a cursor and that you can't refactor easily.</p>
  </blockquote>
  
  <p>Documentation proposes to do in this way</p>
  
  <pre><code>@Query("SELECT * FROM user")
  public List&lt;User&gt; loadUsers();
  </code></pre>
  
  <p>My concerns is that this will actually fetch all data from the table and hold them in a memory (Am I missing sth?). In contrast cursor holds just a bunch of data (window) and fetches a new portion on demand.   </p>
  
  <p>So the question is how to do large database queries using Room DAO keeping low memory usage?   </p>