【问题标题】:How to make a database transaction with Room using functions from differents DAOs and using coroutines?如何使用来自不同 DAO 的函数和使用协程与 Room 进行数据库事务?
【发布时间】:2020-10-20 14:32:00
【问题描述】:

我想使用来自不同 Daos 的函数使用协程与 Room 进行数据库事务。

如果我使用 @Transaction 注释,我只能使用来自同一个 DAO 的函数。如果我使用 Room 数据库功能 runInTransaction 我不能使用协程。

有没有办法做到这一点?

【问题讨论】:

    标签: android database transactions android-room kotlin-coroutines


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2019-11-23
    • 1970-01-01
    • 2020-09-28
    • 2018-07-19
    • 2020-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多