<tfoot id='eJ69A'></tfoot>

    <i id='eJ69A'><tr id='eJ69A'><dt id='eJ69A'><q id='eJ69A'><span id='eJ69A'><b id='eJ69A'><form id='eJ69A'><ins id='eJ69A'></ins><ul id='eJ69A'></ul><sub id='eJ69A'></sub></form><legend id='eJ69A'></legend><bdo id='eJ69A'><pre id='eJ69A'><center id='eJ69A'></center></pre></bdo></b><th id='eJ69A'></th></span></q></dt></tr></i><div id='eJ69A'><tfoot id='eJ69A'></tfoot><dl id='eJ69A'><fieldset id='eJ69A'></fieldset></dl></div>
      • <bdo id='eJ69A'></bdo><ul id='eJ69A'></ul>
      <legend id='eJ69A'><style id='eJ69A'><dir id='eJ69A'><q id='eJ69A'></q></dir></style></legend>

      <small id='eJ69A'></small><noframes id='eJ69A'>

    1. Doctrine Regular vs Fetch join

      Doctrine Regular vs Fetch join(Doctrine Regular vs Fetch join)
    2. <legend id='usskR'><style id='usskR'><dir id='usskR'><q id='usskR'></q></dir></style></legend>

        <small id='usskR'></small><noframes id='usskR'>

            • <bdo id='usskR'></bdo><ul id='usskR'></ul>

                  <tbody id='usskR'></tbody>
                <i id='usskR'><tr id='usskR'><dt id='usskR'><q id='usskR'><span id='usskR'><b id='usskR'><form id='usskR'><ins id='usskR'></ins><ul id='usskR'></ul><sub id='usskR'></sub></form><legend id='usskR'></legend><bdo id='usskR'><pre id='usskR'><center id='usskR'></center></pre></bdo></b><th id='usskR'></th></span></q></dt></tr></i><div id='usskR'><tfoot id='usskR'></tfoot><dl id='usskR'><fieldset id='usskR'></fieldset></dl></div>
                <tfoot id='usskR'></tfoot>
                本文介绍了Doctrine Regular vs Fetch join的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在原则上,regular 和 fetch join 之间的区别是什么?我不只是通过阅读 文档.

                in doctrine, whats the diff between regular and fetch join? i dont get it just by reading the docs.

                // regular
                $query = $em->createQuery("SELECT u FROM User u JOIN u.address a WHERE a.city = 'Berlin'");
                $users = $query->getResult();
                
                // fetch
                $query = $em->createQuery("SELECT u, a FROM User u JOIN u.address a WHERE a.city = 'Berlin'");
                $users = $query->getResult();
                

                fetch join 的目的是什么?如果我 select u, a 为什么我只是得到 users ($users = $query->getResult();)?如果我使用常规连接,我可能可以使用 $user->getAddresses() 来访问相关对象?

                whats the purpose of fetch join? if i select u, a why am i just getting users ($users = $query->getResult();)? if i use a regular join, i can probably use $user->getAddresses() to access the related objects?

                推荐答案

                我认为文档描述得很好.如果您使用 fetch join,相关实体将包含在水合结果中.否则它们不会,如果您随后尝试访问它们,它将触发另一个查询以获取信息.

                I think the docs describe it pretty well. If you use a fetch join, the related entities will be included in the hydrated result. Otherwise they won't, and if you then try to access them it'll fire off another query to get the information.

                这只是是否应将其包含在结果中的问题.

                It's simply a matter of whether or not it should be included in the results.

                这篇关于Doctrine Regular vs Fetch join的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                When should use doctrine ORM and when zend-db-table?(什么时候应该使用学说 ORM,什么时候应该使用 zend-db-table?)
                Doctrine - self-referencing entity - disable fetching of children(Doctrine - 自引用实体 - 禁用获取子项)
                Doctrine 2, query inside entities(原则 2,实体内部查询)
                Complex WHERE clauses using the PHP Doctrine ORM(使用 PHP Doctrine ORM 的复杂 WHERE 子句)
                Doctrine - OneToMany relation, all result row doesn#39;t fetch in object(Doctrine - OneToMany 关系,所有结果行不获取对象)
                Doctrine and unrefreshed relationships(教义和未更新的关系)

                    <small id='8k79c'></small><noframes id='8k79c'>

                  1. <legend id='8k79c'><style id='8k79c'><dir id='8k79c'><q id='8k79c'></q></dir></style></legend>

                        <bdo id='8k79c'></bdo><ul id='8k79c'></ul>

                          <tbody id='8k79c'></tbody>
                        1. <i id='8k79c'><tr id='8k79c'><dt id='8k79c'><q id='8k79c'><span id='8k79c'><b id='8k79c'><form id='8k79c'><ins id='8k79c'></ins><ul id='8k79c'></ul><sub id='8k79c'></sub></form><legend id='8k79c'></legend><bdo id='8k79c'><pre id='8k79c'><center id='8k79c'></center></pre></bdo></b><th id='8k79c'></th></span></q></dt></tr></i><div id='8k79c'><tfoot id='8k79c'></tfoot><dl id='8k79c'><fieldset id='8k79c'></fieldset></dl></div>
                          <tfoot id='8k79c'></tfoot>