title: How can I represent a "many to many" relation with Android Room when column names are same?
body: <p>How can I represent a &quot;many to many&quot; relation with <code>Room</code>? My column names are also the same.</p>
  <p>e.g. I have <code>Guest</code> and <code>Reservation</code>. <code>Reservation</code> can have many <code>Guest</code>'s and a <code>Guest</code> can be part of many Reservations.</p>
  <p>Here are my entity definitions:</p>
  <pre><code>@Entity data class Reservation(
      @PrimaryKey val id: Long,
      val table: String,
      val guests: List&lt;Guest&gt;
  )
  
  @Entity data class Guest(
      @PrimaryKey val id: Long,
      val name: String,
      val email: String
  )
  </code></pre>
  <p>While looking into docs I came across <a href="https://developer.android.com/reference/android/arch/persistence/room/Relation.html" rel="noreferrer"><code>@Relation</code></a>. I found it really confusing though.</p>
  <p>According to this I would want to create a POJO and add the relationships there. So, with my example I did the following:</p>
  <pre><code>data class ReservationForGuest(
      @Embedded val reservation: Reservation,
      @Relation(
          parentColumn = &quot;reservation.id&quot;, 
          entityColumn = &quot;id&quot;, 
          entity = Guest::class
      ) val guestList: List&lt;Guest&gt;
  )
  </code></pre>
  <p>With above I get the compiler error:</p>
  <pre><code>&gt; Cannot figure out how to read this field from a cursor.
  </code></pre>
  <p>I wasn't able to find a working sample of <code>@Relation</code>.</p>