title: Android Room - Usage of foreign key in query
body: <p>I have a <code>Component</code> which contains a foreign key coming from <code>Component_category</code></p>
  
  <p>My purpose is that a component list will be filtered by the selected component category.</p>
  
  <p>Both classes are as followed: </p>
  
  <hr>
  
  <h2>Component</h2>
  
  <pre><code>@Entity(tableName = "component_table", foreignKeys = {
          @ForeignKey(
              entity = Rack.class,
              parentColumns = "rack_id",
              childColumns = "component_id",
              onDelete = ForeignKey.CASCADE,
              onUpdate = ForeignKey.CASCADE
          ),
          @ForeignKey(
              entity = ComponentCat.class,
              parentColumns = "component_cat_id",
              childColumns = "component_id",
              onDelete = ForeignKey.CASCADE,
              onUpdate = ForeignKey.CASCADE
          )
  })
  
  public class Component {
  
      @PrimaryKey(autoGenerate = true)
      @ColumnInfo(name = "component_id")
      public int componentID;
  
      @NonNull
      @ColumnInfo(name = "component_name")
      private String componentName;
  
      // .. omitted
  </code></pre>
  
  <hr>
  
  <h2>Component Category</h2>
  
  <pre><code>@Entity(tableName = "component_cat_table")
  
  public class ComponentCat
  {
      @PrimaryKey(autoGenerate = true)
      @ColumnInfo(name = "component_cat_id")
      public int componentCatID;
  
      @NonNull
      @ColumnInfo(name = "component_cat_name")
      private String componentCatName;
  
      // .. omitted
  </code></pre>
  
  <hr>
  
  <h2>Query</h2>
  
  <p>I want my query to be as followed: </p>
  
  <pre><code> @Query("SELECT * from component_table " +
          "INNER JOIN component_cat_table " +
          "WHERE component_table.component_cat_id == :categoryID ORDER BY component_name ASC")
          LiveData&lt;List&lt;Component&gt;&gt; getFilteredComponents(int categoryID);
  </code></pre>
  
  <p>But at compile time it tells me it can not resolve <code>component_table.component_cat_id</code>. I am also unable to set a name at the foreign key entity in my <code>Component</code> class. I tried a few options but I don't know how to fix the query without 'access' to the foreign key.</p>