title: The field's same name issue in the tables, when join tables in ROOM
body: <p><strong>I'm using ROOM for my project. But I'm having trouble for joining between tables, because the tables have a same name fields.</strong></p>
  
  <p>for example, my project has tree tables, "word" &amp; "favorite" &amp; "bookmark", which has a same name fields.</p>
  
  <p><em>1- word</em></p>
  
  <pre><code>@Entity(tableName = "word")
  public class Word {
  
      @NonNull
      @PrimaryKey(autoGenerate = true)
      private int id;
  
      @NonNull
      private String title;
      private String mean;
      private String pronunciation;
  
      // Getter and Setter
  }
  </code></pre>
  
  <p><em>2- favorite</em></p>
  
  <pre><code>@Entity(tableName = "favorite",
      foreignKeys = @ForeignKey(
              entity = Word.class,
              parentColumns = "id",
              childColumns = "word_id",
              onDelete = CASCADE,
              onUpdate = CASCADE))
  public class Favorite {
  
      @NonNull
      @PrimaryKey
      private int word_id;
      private long time;
  
      // Getter and Setter
  }
  </code></pre>
  
  <p><em>3- bookmark</em></p>
  
  <pre><code>     @Entity(tableName = "bookmark",
           primaryKeys = {"word_id", "category_id"},
           foreignKeys = {
              @ForeignKey(entity = Word.class,
                      parentColumns = "id",
                      childColumns = "word_id",
                      onDelete = CASCADE,
                      onUpdate = CASCADE)})
       public class Bookmark {
           @NonNull
           private int word_id;
           private long time;
           private int color;
  
          // Getter and Setter
  }
  </code></pre>
  
  <p>To create a join between the three, I defined a new type called "WordAndFavoriteAndBookmark", and used "@Embedded" (as shown below).
  and to fix the same field problem, I used <em>prefix</em> as a <a href="https://stackoverflow.com/a/48123812/5869630">Thomas Fischer</a> response</p>
  
  <p><em>4- WordAndFavoriteAndBookmark</em> </p>
  
  <pre><code>   public class WordAndFavoriteAndBookmark {
      @Embedded
      private Word word;
  
      @Embedded(prefix = "favorite_")
      private Favorite favorite;
  
      @Embedded(prefix = "bookmark_")
      private Bookmark bookmark;
  
      //Getter and Setter
      public Word getWord() { return word; }
      public void setWord(Word word) {this.word = word;}    
      public Favorite getFavorite() { return favorite; }    
      public void setFavorite(Favorite favorite) { this.favorite = favorite;}    
      public Bookmark getBookmark() { return bookmark;  }    
      public void setBookmark(Bookmark bookmark) { this.bookmark = bookmark; }    
      }
  </code></pre>
  
  <p>To create a join between these tables I have defined a new <em>@Dao</em>.</p>
  
  <pre><code> @Dao
  public interface WordAndFavoriteAndBookmarkDao {
      @Query("SELECT word.*, favorite.time FROM word LEFT JOIN favorite " +
              "ON word.id = favorite.word_id")
      LiveData&lt;List&lt;WordAndFavoriteAndBookmark&gt;&gt; getAllWordsByFavoritesForLanguage();
      }
  </code></pre>
  
  <p>But again, after using the query, I encounter the error for the following code in my view(Activity or Fragment):</p>
  
  <pre><code>mWordAndFavoriteAndBookmark.getFavorite().getTime();
  </code></pre>
  
  <p><strong>I think this is due to the use of <em>Perfix</em>, but I do not know the solution to this problem</strong></p>
  
  <p><strong><em>EDITED:</em></strong> <strong>by <a href="https://stackoverflow.com/a/51523263/5869630">Thomas Fisher</a> answer, everything is fine. But when used "Count" or "Sum" in my query, I have problem for reading these values and I don't know how to read them.</strong></p>