Detailed log
error: Cannot figure out how to save this field into database. You can
consider adding a type converter for it.
private final java.util.Date m
// Java code will not convert to Kotlin very
// well so here is the Kotlin: Converter
// class
public class Converters {
@TypeConverter
fun fromTimestamp( value: Long?) :
java.sql.Date {
return java.sql.Date(value ?: 0)
}
@TypeConverter
fun dateToTimestamp(date :java.sql.Date?)
:Long {
return date?.getTime() ?: 0
}
// Here is the type converters example in
// Kotlin
@Database(entities = [DbNasaPictures::class],
version = 2)
@TypeConverters(Converters::class)
abstract class PicturesDatabase:
RoomDatabase() {