title: How to create a table with a two or more foreign keys using Android Room?
body: <p><a href="https://i.stack.imgur.com/9NfEH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9NfEH.png" alt="enter image description here"></a></p>
  
  <p>According the <a href="https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model" rel="noreferrer">entity-relationship model</a>, the relationship between <code>tbl_post</code> and <code>tbl_category</code> could be specified using <a href="https://developer.android.com/topic/libraries/architecture/room.html" rel="noreferrer">Room Persistency Library</a> as follows:</p>
  
  <pre><code>@Entity(foreignKeys = @ForeignKey(
      entity = TblPost.class,
      parentColumns = "id",
      childColumns = "tbl_post_id")
  )
  class TblPostCategory {
      @PrimaryKey
      public String id;
  
      @ColumnInfo(name = "user_id")
      public String postId;
  }
  </code></pre>
  
  <p>However <code>TblPostCategory</code> depends on two foreign keys: <code>post_id</code> and <code>category_id</code> from <code>TblPost</code> and <code>TbCategory</code>.</p>
  
  <p>How the relationship should be described using Room annotations?</p>