android - OrmLite Android,将 foreignAutoRefresh 设置为 true 会导致加入(自加入)查询吗?

标签 android ormlite

在 Android 下使用 ORMLite,当您将 foreignAutoRefresh 设置为 true 时,这会导致连接查询还是 ORMLite 会一个接一个地发出两个查询——“主查询”和对外部对象的调用 dao.refresh?我的意思是这是一个依赖子查询还是发送了两个查询?

最佳答案

引用ORMLite来自 foreignAutoRefresh javadocs 的文档:

Set this to be true (default false) to have a foreign field automagically refreshed when an object is queried. This will not automagically create the foreign object but when the object is queried, a separate database call will be made to load of the fields of the foreign object via an internal DAO. The default is to just have the ID field in the object retrieved and for the caller to call refresh on the correct DAO.

粗体是我的。 ORMLite 此时不执行任何 JOIN,但会为任何自动刷新和其他操作发出单独的数据库查询。

关于android - OrmLite Android,将 foreignAutoRefresh 设置为 true 会导致加入(自加入)查询吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10108166/

相关文章:

java - 使 ViewPager 的高度等于 PagerAdapter 中最高的项目

Android:微调器显示来自网络服务的内容

java - 如何使用 ORM Lite 保留 Java8 LocalDate/LocalDateTime?

android - getRunningAppProcesses() 返回被销毁的进程

android -/system/lib64/libart.so 中的 native 崩溃

android - Proguard with orrmlite - 参数化集合

android - ORMLite 中是否继承了 ID 字段?

java - 为什么不能对 ormlite 中具有 DataType.SERIALIZABLE 的列执行 isNotNull?

android - 导入android.os.CancellationSignal无法在Android上解析ORMLite

java - Activity 中的 onCreate 忽略所有调用堆栈序列