Room Persistence @Relation working in Java but not in Kolin

前端 未结 2 1912
星月不相逢
星月不相逢 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条回答
  • 2021-02-20 06:08

    Try to update room to 1.0.0-alpha8 and add List<@JvmSuppressWildcards Pet>.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题