带有inheritance接口的DAO房间
我有一个DAO接口,其中我有多个实现,我想其中之一是一个房间实施( Kotlin ):
interface BaseDao { fun getAll(): Single<List> fun insert(data: List) }
和我的房间(RxRoom)接口:
@Dao interface RxRoomBaseDao: BaseDao { @Query("SELECT * FROM some_data") override fun getAll(): Single<List> @Insert(onConflict = OnConflictStrategy.REPLACE) override fun insert(data: List) }
它看起来像房间编译器试图编译BaseDao
而不是RxRoomBaseDao
和抱怨error: Dao class must be annotated with @Dao
和两种方法error: A DAO method can be annotated with only one of the following:Insert,Delete,Query,Update
。
我也尝试了与RxRoomBaseDao
具有相同结果的抽象类。
这是一个已知的错误或房间编译器的限制? 我怎么能达到我想要的,而不会污染我的BaseDao
与房间的注释?