Room Persistence @Relation working in Java but not in Kolin

前端 未结 2 1873
星月不相逢
星月不相逢 2021-02-20 05:48

Base on my previous question (Android Persistence room: "Cannot figure out how to read this field from a cursor") which I got to work thanks the feedback, I implemente

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-20 06:14

    try changing your query @Query("SELECT * FROM pet WHERE id IN (:p0)")

    to @Query("SELECT * FROM pet WHERE id IN (:petIds)")

    There was an issue between kotlin and Room lib, Kotlin wasn't preserving the actual parameter names of the arguments properly, so (:p0)/(:arg0) was work around that, its resolved now.

    I hope this will resolve the issue

提交回复
热议问题