You can provide type converters class DateConverter { @TypeConverter fun toDate(timestamp: Long?): Date? { return if (timestamp == null) null else Date(timestamp) } @TypeConverter fun toTimestamp(date: Date?): Long? { return date?.time } }
You can provide type converters Offers conflict resolution strategies @Dao interface UserDao { @Query("select * from user") fun loadAllUsers(): Single<List<User>> @Insert(onConflict = REPLACE) fun insertUser(user: User) }
You can provide type converters Even better in Kotlin @Entity @TypeConverters(DateConverter::class) class Weight { @ColumnInfo(name = "kilogramsValue") var kilogramsValue: Float = 0.0f @ColumnInfo(name = "date") @PrimaryKey(autoGenerate = false) var date: Date? = null } Offers conflict resolution strategies
You can provide type converters @Dao interface UserDao { @Query("select * from user") fun loadAllUsers(): Single<List<User>> @Query("select * from user where id = :arg0") fun loadUserById(id: Int): Maybe<User> } Even better in Kotlin Offers conflict resolution strategies *ish
You can provide type converters @Dao @TypeConverters(DateConverter::class) interface WeightDao { @Query("select * from weight") fun loadAllWeights(): Flowable<List<Weight>> @Query("select * from weight where date = :arg0") fun loadWeightByDate(date: Date): Maybe<Weight> } Even better in Kotlin Offers conflict resolution strategies Compatible with Live Data or RxJava *ish
You can provide type converters Offers conflict resolution strategies Compatible with Live Data or RxJava Threads, Benchmarks, etc. ? Even better in Kotlin *ish