Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your comments indicate that you've already answered you problem. You can certainly create a column named "_id" using <a href="http://ormlite.com/" rel="nofollow noreferrer">ORMLite</a>:</p> <pre><code>@DatabaseField(generatedId = true) private int _id; </code></pre> <p>or</p> <pre><code>@DatabaseField(generatedId = true, columnName = "_id") private int id; </code></pre> <p>If you are working with <code>Cursor</code>s then you may want to take a look at the <code>last()</code> and <code>moveAbsolute(...)</code> methods on the <code>DatabaseResults</code> class. Also, the <a href="http://ormlite.com/javadoc/ormlite-android/com/j256/ormlite/android/AndroidDatabaseResults.html" rel="nofollow noreferrer"><code>AndroidDatabaseResults</code></a> (which you can cast to) also has a <code>getRawCursor()</code> method which returns the underlying <code>Cursor</code> object and has additional <code>getCount()</code> and <code>getPosition()</code> methods.</p> <p>Here are some more information about ORMLite and <code>Cursor</code>s:</p> <blockquote> <p><a href="https://stackoverflow.com/questions/7159816/android-cursor-with-ormlite">Android Cursor with ORMLite to use in CursorAdapter</a></p> </blockquote> <p>You can get access to the <code>Cursor</code> using something like the following:</p> <pre><code>// build your query QueryBuilder&lt;Foo, String&gt; qb = fooDao.queryBuilder(); qb.where()...; // when you are done, prepare your query and build an iterator CloseableIterator&lt;Foo&gt; iterator = dao.iterator(qb.prepare()); try { // get the raw results which can be cast under Android AndroidDatabaseResults results = (AndroidDatabaseResults)iterator.getRawResults(); Cursor cursor = results.getRawCursor(); ... } finally { iterator.closeQuietly(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload