Anyone used Room? Having issue with TypeConverter ...
# android
h
Anyone used Room? Having issue with TypeConverter converting my
java.util.date
.
Copy code
class DateTypeConverter {
    companion object {
        @TypeConverter
        fun fromTimestamp(value: Long?): Date? {
            return if (value == null) null else Date(value)
        }

        @TypeConverter
        fun dateToTimestamp(date: Date): Long {
            return date.time
        }
    }
}
and my compiler reporting:
DateTypeConverter.java:3: error: Class is referenced as a converter but it does not have any converter methods.
and my article entity looks like this:
Copy code
@Entity(tableName = "articles")
data class ArticleDb(@ColumnInfo var articleId: String,
                     @ColumnInfo var date: Date) {
    @ColumnInfo
    @PrimaryKey(autoGenerate = true) var id: Long = 0
}
Any ideas whats wrong?