title: How to store objects in Android Room?
body: <p>Basically, there are two things I don't understand: objects with objects and objects with lists of objects</p>
  
  <p>Say I receive a list of objects from the server. Each of them looks like this:</p>
  
  <pre><code>@Entity
  public class BigObject {
      @PrimaryKey
      private int id;
      private User user;
      private List&lt;SmallObject&gt; smallObjects;
  }
  </code></pre>
  
  <p>with these two objects as fields:</p>
  
  <pre><code>@Entity
  public class User {
      @PrimaryKey
      private int id;
      private String name;
      @TypeConverters(GenderConverter.class)
      public MyEnums.Gender gender;
  }
  
  @Entity
  public class SmallObject {
      @PrimaryKey (autoGenerate = true)
      private int id;
      private String smallValue;
  }
  </code></pre>
  
  <p>They are more complicated than this, so I can't use @TypeConverters as Room suggests:</p>
  
  <pre><code>error: Cannot figure out how to save this field into database. You can consider adding a type converter for it.
  </code></pre>
  
  <p>How do I store this data structure in Room?</p>