简体   繁体   中英

roomdb RawQuery with relation return livedata

I have roomdb dao take SupportSQLiteQuery, with single table it works great and fine, the dark come with relations

  @Dao
        interface ItemDao {
            @Transaction
            @RawQuery(observedEntities = [
                OrderWithItemsWithVoucher::class]
               )
         fun getItemsWithVouchersRawPagging(query: SupportSQLiteQuery):LiveData<OrderWithItemsWithVoucher>
    
    }
    
data class ItemWithVoucher(
        @Embedded var vouchers: OrderVoucher,
        @Relation(parentColumn = "orderItemId", entityColumn = "orderItemId")
        var orderItems: OrderItems
)

data class OrderWithItemsWithVoucher(
        @Embedded     var order: OrderDB,
        @Relation(entity = OrderVoucher::class  ,parentColumn = "orderId", entityColumn = "orderId")
        var itemWithVoucher: ItemWithVoucher
)

But at compile time I got this

       return _result;
               ^
  symbol:   variable _result
  location: class ItemDao_Impl
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

//Roomdb

 def room_version = '2.3.0-alpha02'
    implementation "androidx.room:room-ktx:$room_version"
    implementation "androidx.room:room-runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM