Android Room Database Ignore Problem “Tried the following constructors but they failed to match”
问题 My entity class: @Entity(tableName = "student") data class Student( var name: String, var age: Int, var gpa: Double, var isSingle: Boolean, @PrimaryKey(autoGenerate = true) var id: Long = 0, @Ignore //don't create column in database, just for run time use var isSelected: Boolean = false ) And then I insert like this (tested in androidTest ): val student = Student("Sam", 27, 3.5, true) studentDao.insert(student) It gives me this error right after I added the @Ignore annotation: C:\Android