I\'m converting a project to Kotlin and I\'m trying to make my model (which is also my entity) a data class I intend to use Moshi to convert the JSON responses from the API<
For a variation on FutureShocked answer that implements autoGenerate:
@Entity(tableName = "movies")
data class MovieKt(
var title: String,
var overview: String,
var poster_path: String,
var backdrop_path: String,
@Ignore var release_date: String,
@Ignore var vote_average: Double,
@Ignore var isFavorite: Int
) {
@PrimaryKey(autoGenerate = true) var id : Int = 0
constructor(title: String, overview: String, poster_path: String, backdrop_path: String) {
this(id, title, overview, poster_path, backdrop_path, "", 0.0, 0)
}
}