title: Insert a list of objects in the local base, Room
body: <p>I have the CidVo class:</p>
  
  <pre><code>@Entity
  public class CidVo implements Serializable {
  
      private static final long serialVersionUID = 6128323407787450445L;
  
      @NonNull
      @PrimaryKey
      private String idCid;
  
      private String dsCid;
      //private StatusType idStatus;
  
      public CidVo() {
          super();
      }
  
      public String getIdCid() {
          return idCid;
      }
  
      public void setIdCid(String idCid) {
          this.idCid = idCid;
      }
  
      public String getDsCid() {
          return dsCid;
      }
  
      public void setDsCid(String dsCid) {
          this.dsCid = dsCid;
      }
  
      /*public StatusType getIdStatus() {
          return idStatus;
      }
  
      public void setIdStatus(StatusType idStatus) {
          this.idStatus = idStatus;
      } */
  
  }
  </code></pre>
  
  <p>The DAO class:</p>
  
  <pre><code>@Dao
  public interface CIDDao {
  
      @Insert(onConflict = OnConflictStrategy.REPLACE)
      void insertAllCID(ArrayList&lt;CidVo&gt;... cidVos);
  }
  </code></pre>
  
  <p>I get a list of objects, via JSON. And I would like to save it in the database.
  But, I get this return error when trying to compile:</p>
  
  <blockquote>
    <p>Error:Entity class must be annotated with @Entity
    E:\workspace_android_studio\app_atendimento_branch_test\app\src\main\java\br\com\sisteplan\app\atendimento\Model\CIDDao.java
    Error:(19, 43) error: Type of the parameter must be a class annotated
    with @Entity or a collection/array of it.</p>
  </blockquote>
  
  <p>How to solve this question?
  The following is the postExecute:</p>
  
  <pre><code> @Override
      protected void onPostExecute(AsyncTaskResult&lt;Retorno&gt; respAtestadoVo) {
          super.onPostExecute(respAtestadoVo);
          if (respAtestadoVo.getExceptionResult() == null) {
              RetornoCid retornoCid = (RetornoCid) respAtestadoVo.getResult();
              ArrayList&lt;CidVo&gt; cidVos = (ArrayList&lt;CidVo&gt;) retornoCid.getRetorno();
  
              appDataBase.getCidDao().insertAllCID(cidVos);
  
              Toast.makeText(context, "Sucesso", Toast.LENGTH_SHORT).show();
          }
      }
  </code></pre>
  
  <p>Instance:</p>
  
  <pre><code>@Database(entities = {CidVo.class}, version = 1)
  public abstract class AppDataBase extends RoomDatabase {
      public abstract CIDDao getCidDao();
  
      private static AppDataBase appDataBase;
  
      public static AppDataBase getInstance(Context context){
          if(null == appDataBase){
              appDataBase = buildDataBaseInstance(context);
          }
          return appDataBase;
      }
  
      private static AppDataBase buildDataBaseInstance(Context context){
          return Room.databaseBuilder(context,
                  AppDataBase.class,
                  "app_database")
                  .allowMainThreadQueries().build();
      }
  
      private void cleanUp(){
          appDataBase = null;
      }
  
  }
  </code></pre>