title: Room error - "Cannot figure out how to save this field into database. You can consider adding a type converter for it."
body: <p>I want to store class Reservation that a user makes when going to a cinema to watch a movie and I can't figure out how to convert it so that room can store it in the data base.</p>
  <p>Errors appear for members: places and codeQR.</p>
  <p>Class Reservation:</p>
  <pre><code>@Entity(tableName = &quot;reservations&quot;, foreignKeys = @ForeignKey(entity = UtilizatorMADA.class, parentColumns = &quot;id&quot;, childColumns = &quot;idUser&quot;))
  public class Reservation implements Serializable {
                  @PrimaryKey(autoGenerate = true)
                  private long idReservation;
                  private long idUser;
                  @Embedded private Film film;
                  private Time startTime;
                  private List&lt;Integer&gt; places;
                  private Bitmap codeQR;
              
                  @Ignore
                  public Reservation(){}
              
                  public Reservation(long idReservation, long idUser, Film film, Time startTime, List&lt;Integer&gt; places, Bitmap codeQR) {
                      this.idReservation = idReservation;
                      this.idUser = idUser;
                      this.film = film;
                      this.startTime = startTime;
                      this.places = places;
                      this.codeQR = codeQR;
                  }
              
                  @Ignore
                  public Reservation(long idUser, Film film, Time startTime, List&lt;Integer&gt; places, Bitmap codeQR) {
                      this.idUser = idUser;
                      this.film = film;
                      this.startTime = startTime;
                      this.places = places;
                      this.codeQR = codeQR;
                  }
              
                  @Ignore
                  public Reservation(Film film, Time startTime, List&lt;Integer&gt; places, Bitmap codeQR) {
                      this.film = film;
                      this.startTime = startTime;
                      this.places = places;
                      this.codeQR = codeQR;
                  }
              
                  public long getIdReservation() {
                      return idReservation;
                  }
              
                  public void setIdReservation(long idReservation) {
                      this.idReservation = idReservation;
                  }
              
                  public long getIdUser() {
                      return idUser;
                  }
              
                  public void setIdUser(long idUser) {
                      this.idUser = idUser;
                  }
              
                  public void setPlaces(List&lt;Integer&gt; places) {
                      this.places = places;
                  }
              
                  public Film getFilm() {
                      return film;
                  }
              
                  public void setFilm(Film film) {
                      this.film = film;
                  }
              
                  public Time getStartTime() {
                      return startTime;
                  }
              
                  public void setStartTime(Time startTime) {
                      this.startTime = startTime;
                  }
              
                  public Bitmap getCodeQR() {
                      return codeQR;
                  }
              
                  public void setCodeQR(Bitmap codeQR) {
                      this.codeQR = codeQR;
                  }
              
                  public List&lt;Integer&gt; getPlaces() { return places; }
              
                  @Override
                  public String toString() {
                      return &quot;Reservation{&quot; +
                              &quot;film=&quot; + film +
                              &quot;, startTime=&quot; + startTime +
                              &quot;, codeQR='&quot; + codeQR + '\'' +
                              '}';
                  }
              
                  @RequiresApi(api = Build.VERSION_CODES.KITKAT)
                  @Override
                  public boolean equals(Object o) {
                      if (this == o) return true;
            
          
            if (o == null || getClass() != o.getClass()) return false;
                  Reservation that = (Reservation) o;
                  return Objects.equals(film, that.film) &amp;&amp;
                          Objects.equals(startTime, that.startTime) &amp;&amp;
                          Objects.equals(places, that.places);
              }
          
              @RequiresApi(api = Build.VERSION_CODES.KITKAT)
              @Override
              public int hashCode() {
                  return Objects.hash(film, startTime, places);
              }
          }
  </code></pre>
  <p>Class Film:</p>
  <pre><code>@Entity(tableName = &quot;films&quot;)
  public class Film implements Serializable {
      @PrimaryKey(autoGenerate = true)
      private int idFilm;
      private String title;
      private String genre;
      private String description;
      private double rating;
      private int imagePath;
      private boolean isFavorite;
  
      public Film(int idFilm, String title, String genre, String description, double rating, int imagePath, boolean isFavorite) {
          this.idFilm = idFilm;
          this.title = title;
          this.genre = genre;
          this.description = description;
          this.rating = rating;
          this.imagePath = imagePath;
          this.isFavorite = isFavorite;
      }
  
      @Ignore
      public Film(String title, String genre, String description, double rating, int imagePath) {
          this.title = title;
          this.genre = genre;
          this.description = description;
          this.rating = rating;
          this.imagePath = imagePath;
          isFavorite = false;
      }
  
      @Ignore
      public Film(String title) {
          this.title = title;
      }
  
      public int getIdFilm() {
          return idFilm;
      }
  
      public void setIdFilm(int idFilm) {
          this.idFilm = idFilm;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
      public String getGenre() {
          return genre;
      }
  
      public void setGenre(String genre) {
          this.genre = genre;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
      public double getRating() {
          return rating;
      }
  
      public void setRating(double rating) {
          this.rating = rating;
      }
  
      public int getImagePath() {
          return imagePath;
      }
  
      public void setImagePath(int imagePath) {
          this.imagePath = imagePath;
      }
  
      public boolean isFavorite() {
          return isFavorite;
      }
  
      public void setFavorite(boolean favorite) {
          isFavorite = favorite;
      }
  
      @Override
      public boolean equals(Object o) {
          if (this == o) return true;
          if (o == null || getClass() != o.getClass()) return false;
          Film film = (Film) o;
          return Objects.equals(title, film.title);
      }
  
      @Override
      public int hashCode() {
          return Objects.hash(title);
      }
  }
  </code></pre>
  <p>I also get the following error by the ReservationOfMoviesDao, which may or may not be related. The queries affected are: getReservationOfMoviesByUserId(long id), getReservationOfMovies() and getReservationOfMoviesByRservationId(long id);</p>
  <p>error: The columns returned by the query does not have the fields [idFilm] in com.example.cinemaapp.model.ReservationMovie even though they are annotated as non-null or primitive. Columns returned by the query: [idReservation,idUser,film,startTime,places,codeQR]</p>
  <p>Interface ReservationOfMoviesDao:</p>
  <pre><code>@Dao
  public interface ReservationOfMoviesDao {
      @Insert(onConflict = OnConflictStrategy.IGNORE)
      void insert(ReservationMovie rm);
  
      @Transaction
      @Query(&quot;SELECT * FROM reservations where idUser = :id&quot;)
      List&lt;ReservationMovie&gt; getReservationOfMoviesByUserId(long id);
  
      @Transaction
      @Query(&quot;SELECT * FROM reservations&quot;)
      List&lt;ReservationMovie&gt; getReservationOfMovies();
  
      @Transaction
      @Query(&quot;SELECT * FROM reservations where idReservation = :id&quot;)
      ReservationMovie getReservationOfMoviesByReservationId(long id);
  }
  </code></pre>
  <p>If you could help me out please, I'd appreciate it.</p>