微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

房间查询成功找到数据但未返回结果集

如何解决房间查询成功找到数据但未返回结果集

我正在使用Android Room查询数据库并返回结果集。查询成功,因为我可以看到记录来自DAO_impl处理,但实际上并没有返回记录。这是来自结果的调试屏幕截图

enter image description here

```

以下是执行的主要视图模型代码

  public ContactTable identifyContactByDeviceMobileNumber(String deviceMobileNumber) {
        executor.execute(() ->{contactTableRepository.findContactByDeviceMobileNumber(deviceMobileNumber);});
        return foundContactByDeviceMobileNumber;
    };

这是查询的联系表存储库

 public ContactTable findContactByDeviceMobileNumber(String mobileDeviceNumber) {
        contactTableDao.findContactByDeviceMobileNumber(mobileDeviceNumber);
        return foundContactByDeviceMobileNumber;
 }
   

这是查询的DAO条目

 @Query("SELECT * FROM contact_table WHERE contactMobileNumber = :contactMobileNumber")
    public abstract ContactTable findContactByDeviceMobileNumber(String contactMobileNumber); 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。