从Java代码访问kotlin Suspend函数

I have Room database interface which is a Kotlin file and as I dont want the calls to run on mainthread I am using kotlin Suspend. how can I use suspend function from java

I have two method where I want to insert a User and another to retrieve the users

这些是我在Java文件中遇到的错误

enter image description here

会议室界面

UserDao

@Dao
interface UserDao {

    fun getAllUsersAsync(): CompletableFuture<List<User>> =
        GlobalScope.future { getAllUsers() }

    @Query("SELECT * FROM user")
    suspend fun getAllUsers(): List<User>

    @Insert
    suspend fun insertUser(user: User): Long
}

Java代码

private Long addUser(com.i6systems.in2plane.AppDatabase.User user) {
    return userDao.insertUser(user);
}

private List<com.i6systems.in2plane.AppDatabase.User> getUsers () {
    return userDao.getAllUsersAsync();
}

非常感谢您的帮助

谢谢 [R