在 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/