I have a data class
@Entity(tableName = "type")
data class Type(
@PrimaryKey(autoGenerate = true) var id: Int = 0,
var type: Int = 0
)
When compiling project I receive message
Error:Room cannot pick a constructor since multiple constructors are suitable.
But if I change data class to
@Entity(tableName = "type")
data class Type(
@PrimaryKey(autoGenerate = true) var id: Int = 0,
var type: String = ""
)
or java class
@Entity(tableName = "type")
public class Type {
@PrimaryKey(autoGenerate = true)
private int id;
private int type;
// getters and setters
}
it works fine. Is it Kotlin bug or something else?