The insert statement is not correct
@Dao
interface WordDao {
@Insert(onConflict = OnConflictStrategy.IGNORE)
suspend fun insertWord(word: Word)
@Insert(onConflict = OnConflictStrategy.IGNORE)
suspend fun insertWords(words: List<Word>)
@Insert(onConflict = OnConflictStrategy.IGNORE)
suspend fun insertWords1(varargs words: Word)
}
Since Word
is an entity
@Entity(tableName = "word_table")
data class Word (
@PrimaryKey
var id: Int,
var wordEn: String,
var wordRu: List<String>
)
Room ?? Coroutines
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…