Android Room Database Create Entity Object without Id
Don't place the id in the constructor:
@Entity(tableName = "student")
data class Student(
val name: String,
val age: Int,
val gpa: Double,
val isSingle: Boolean
) {
@PrimaryKey(autoGenerate = true)
var id: Long? = null
}