title: Android Room - Get the id of new inserted row with auto-generate
body: <p>This is how I am inserting data into database using Room Persistence Library:</p>
  
  <p>Entity:</p>
  
  <pre><code>@Entity
  class User {
      @PrimaryKey(autoGenerate = true)
      public int id;
      //...
  }
  </code></pre>
  
  <p>Data access object:</p>
  
  <pre><code>@Dao
  public interface UserDao{
      @Insert(onConflict = IGNORE)
      void insertUser(User user);
      //...
  }
  </code></pre>
  
  <p>Is it possible to return the id of User once the insertion is completed in the above method itself without writing a separate select query?</p>