I am getting a list of strings from API, same when I tried to insert in Room Db, I am getting an error -
Type of the parameter must be a class annotated with @Entity or a collection/array of it.
Here is my method
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertAll(list: List<String>). --> this method giving error
And this is table for it
@Entity(tableName = "insuree")
public class Insuree {
@ColumnInfo(name = "insurerName")
@NonNull
public String insurerName;
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "_id")
public int id;
}
How can I resolve this error, or is there any other way to get this thing work.