久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

    <tfoot id='1YpwR'></tfoot>

    <small id='1YpwR'></small><noframes id='1YpwR'>

        <bdo id='1YpwR'></bdo><ul id='1YpwR'></ul>

      1. Doctrine2 和 Zend 框架中的多數據庫連接

        Multiple database connection in Doctrine2 and Zend framework(Doctrine2 和 Zend 框架中的多數據庫連接)
        <i id='VuN5u'><tr id='VuN5u'><dt id='VuN5u'><q id='VuN5u'><span id='VuN5u'><b id='VuN5u'><form id='VuN5u'><ins id='VuN5u'></ins><ul id='VuN5u'></ul><sub id='VuN5u'></sub></form><legend id='VuN5u'></legend><bdo id='VuN5u'><pre id='VuN5u'><center id='VuN5u'></center></pre></bdo></b><th id='VuN5u'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VuN5u'><tfoot id='VuN5u'></tfoot><dl id='VuN5u'><fieldset id='VuN5u'></fieldset></dl></div>
        • <legend id='VuN5u'><style id='VuN5u'><dir id='VuN5u'><q id='VuN5u'></q></dir></style></legend>

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

              <tfoot id='VuN5u'></tfoot>
                <bdo id='VuN5u'></bdo><ul id='VuN5u'></ul>

                  <tbody id='VuN5u'></tbody>

                  本文介紹了Doctrine2 和 Zend 框架中的多數據庫連接的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我目前正在開發一個使用 ZF 1.11.3 構建的應用程序 - Doctrine2 是所使用的 ORM 組件.我需要使用多個數據庫.在 application.ini 文件中,我按如下方式設置了數據庫連接:

                  I am currently working on an application which is built using ZF 1.11.3 - Doctrine2 is the ORM component used. I need to use multiple databases. Within the application.ini file, I have set the database connections as follows:

                  resources.doctrine.dbal.connections.default.parameters.dbname   = "db_name_one"
                  resources.doctrine.dbal.connections.secondary.parameters.dbname   = "db_name_two"
                  

                  我如何將基于第二個數據庫連接的 Doctrine2 實體類與該連接相關聯:例如,如果我有一個來自第二個連接的實體類:

                  How would I associate the Doctrine2 entity classes based on the second database connection with that connection: For example, if I have an entity class from the second connection as:

                  /*
                     * @Entity
                     * @Table(name="tableOnSecondDatabase")
                     */
                    Class EntityFromSecond
                    {
                  

                  Doctrine2/ZF 如何知道哪些實體類映射到數據庫?感謝您的幫助.

                  How will Doctrine2/ZF know what entity classes are mapped to a database? Thanks for helping.

                  推薦答案

                  我不認為您可以將實體綁定到特定連接,這在 Doctrine 2 架構中沒有意義.

                  I don't thinl you can bind an entity to specific connection, it wouldn't make sense in the Doctrine 2 architecture.

                  另一方面,您可以做的是擁有兩個 EntityManager,每個都有不同的連接選項.您必須在業務邏輯中決定哪個實體由哪個連接管理器處理.

                  What you can do, on the other hand is to have two EntityManagers, each with different connection options. You must decide in your business logic, which entity is treated by which connection manager.

                  編輯 原則 2 不支持跨數據庫連接,因為它具有兩個不同的連接并跨它們連接,AFAIK.我什至無法想象,這將如何在 PHP PDO 級別上工作.Vijay 對基于 Doctrine 1 和第二個的建議的建議,這并不完全是跨數據庫連接,因為 Doctrine 1 執行 2 個查詢并合并結果本身,這在性能方面不是最佳的.

                  edit Doctrine 2 does not support cross database joins in the sense of having two distinct connections and joining across them, AFAIK. I can't even imagine, how that would work on the PHP PDO level. What Vijay suggested for one based around Doctrine 1 and second, that's not exactly cross database join, as Doctrine 1 executes 2 queries and merges the results itself, which is not optimal performance-wise.

                  另一方面,你可以做的是建立一個連接,它可以訪問兩個數據庫(也就是說,如果它們在同一個數據庫服務器上)或模式,如果你在說 Postgres,并定義您的實體:

                  What you could do, on the other hand, is to have one connection, which can access both databases (that is, if they're on the same DB server), or schemas, if you're on say Postgres, and define your entities as such:

                  //defining first entity
                  @Entity
                  @Table(firstSchema.table_name)
                  class MyEntity
                  
                  //defining second entity
                  
                  @Entity
                  @Table(secondSchema.table_name)
                  class SecondEntity
                  

                  這應該可行,我相信

                  這篇關于Doctrine2 和 Zend 框架中的多數據庫連接的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                    <tbody id='APHho'></tbody>
                  <tfoot id='APHho'></tfoot>

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

                      <bdo id='APHho'></bdo><ul id='APHho'></ul>

                        <legend id='APHho'><style id='APHho'><dir id='APHho'><q id='APHho'></q></dir></style></legend>
                          <i id='APHho'><tr id='APHho'><dt id='APHho'><q id='APHho'><span id='APHho'><b id='APHho'><form id='APHho'><ins id='APHho'></ins><ul id='APHho'></ul><sub id='APHho'></sub></form><legend id='APHho'></legend><bdo id='APHho'><pre id='APHho'><center id='APHho'></center></pre></bdo></b><th id='APHho'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='APHho'><tfoot id='APHho'></tfoot><dl id='APHho'><fieldset id='APHho'></fieldset></dl></div>
                          1. 主站蜘蛛池模板: 国产精品久久 | 蜜臀久久 | 亚洲一区二区三区高清 | 国产 日韩 欧美 在线 | 中文字幕亚洲专区 | 亚洲欧美久久 | 国产成人精品在线 | 黑人粗黑大躁护士 | 欧美国产激情二区三区 | 午夜一级大片 | 久久久免费精品 | 一区二区在线不卡 | 国产精品视频网 | 国产一区三区视频 | 中文字幕 国产精品 | 亚洲精品久 | 精品欧美一区二区三区精品久久 | 国产一区二区三区www | 午夜电影在线播放 | 国色天香成人网 | 天天躁人人躁人人躁狂躁 | 女人夜夜春 | 日韩av高清| 99pao成人国产永久免费视频 | 国产综合视频 | 欧美一区二区在线播放 | 成人精品在线观看 | 一本久久a久久精品亚洲 | 欧美黄色片 | 午夜小视频在线播放 | 99久久国产免费 | 久久国产欧美日韩精品 | 特黄av| 亚洲一二三区不卡 | 国产精品久久九九 | 视频一区在线 | 国产精品国产精品国产专区不卡 | 欧美精品1区2区 | 综合久 | 一区二区三区久久久 | 在线播放一区二区三区 |