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

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

    <legend id='iNtI4'><style id='iNtI4'><dir id='iNtI4'><q id='iNtI4'></q></dir></style></legend>
    <tfoot id='iNtI4'></tfoot>

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

    1. <small id='iNtI4'></small><noframes id='iNtI4'>

      1. Spring Data JDBC - 多對一關系

        Spring Data JDBC - Many-to-One Relationship(Spring Data JDBC - 多對一關系)
        1. <tfoot id='YLr6i'></tfoot>
            <tbody id='YLr6i'></tbody>

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

              • <small id='YLr6i'></small><noframes id='YLr6i'>

                  <legend id='YLr6i'><style id='YLr6i'><dir id='YLr6i'><q id='YLr6i'></q></dir></style></legend>

                  本文介紹了Spring Data JDBC - 多對一關系的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我似乎在網上找不到任何關于在 Spring JDBC 中使用多對一映射的參考資料.我剛剛在不支持的文檔中看到了,但我不確定是否是這種情況.

                  I can't seem to find any reference online with regards to using a Many-To-One mapping in Spring JDBC. I just saw in the documentation that is not supported but I'm not sure if this is the case.

                  我的示例是我想將我的 AppUser 映射到特定部門.

                  My example is that I want to map my AppUser to a particular Department.

                  作為參考,AppUser 使用 DEPARTMENT_ID 加入 Department 表

                  For reference, AppUser joins to Department table using DEPARTMENT_ID

                  @Table(value="m_appuser")
                  public class AppUserProjectionTwo {
                      @Id
                      private Long id;
                      private String firstname;
                      private String middlename;
                      private String lastname;
                  
                  
                  
                      @Column("DEPARTMENT_ID")
                      private DepartmentProjection departmenProjection;
                  
                      public Long getId() {
                          return id;
                      }
                  
                      public void setId(Long id) {
                          this.id = id;
                      }
                  
                  

                  但是,它似乎無法正確映射.

                  However, it seems that it won't map properly.

                  @Table("M_DEPARTMENT")
                  public class DepartmentProjection {
                      @Id
                      private Long id;
                  
                      public Long getId() {
                          return id;
                      }
                  
                      public void setId(Long id) {
                          this.id = id;
                      }
                  

                  創建的查詢如下所示.我正在尋找更多相反的東西,其中 M_APPUSER.department_ID = Department.id

                  The created query looks like this. I was looking for something more of the opposite in which M_APPUSER.department_ID = Department.id

                  [SELECT "m_appuser"."ID" AS "ID", "m_appuser"."LASTNAME" AS "LASTNAME", "m_appuser"."FIRSTNAME" AS "FIRSTNAME", "m_appuser"."MIDDLENAME" AS "MIDDLENAME", "departmenProjection"."ID" AS "DEPARTMENPROJECTION_ID" FROM "m_appuser" LEFT OUTER JOIN "M_DEPARTMENT" AS "departmenProjection" ON "departmenProjection"."DEPARTMENT_ID" = "m_appuser"."ID" WHERE "m_appuser"."FIRSTNAME" = ?];
                  

                  謝謝

                  推薦答案

                  我剛剛在文檔中看到不支持,但我不確定是否是這種情況.

                  I just saw in the documentation that is not supported but I'm not sure if this is the case.

                  我可以確認它不受支持.多對一關系跨越聚合的邊界.跨聚合的引用必須建模為被引用聚合的 id.

                  I can confirm it is not supported. Many-To-One relationships cross the boundaries of aggregates. References across aggregates must be modelled as ids of the referenced aggregate.

                  如果你不這樣做,Spring Data JDBC 將把引用視為一對一關系和同一聚合的一部分,這將對多對一關系產生你不想要的影響,例如當被引用的實體被刪除時,被引用的實體被刪除.這對于同一聚合中的一對一關系是正確的.

                  If you don't do this Spring Data JDBC will consider the reference a One-To-One relationship and part of the same aggregate which will have effects you don't want for a Many-To-One relationship, like the referenced entity getting deleted when the referenced entity gets deleted. Which would be correct for a One-To-One relationship within the same aggregate.

                  這在 中有更詳細的解釋https://spring.io/blog/2018/09/24/spring-data-jdbc-references-and-aggregates

                  這篇關于Spring Data JDBC - 多對一關系的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                    <legend id='gKnlx'><style id='gKnlx'><dir id='gKnlx'><q id='gKnlx'></q></dir></style></legend>

                        <tbody id='gKnlx'></tbody>
                      <tfoot id='gKnlx'></tfoot>
                        <bdo id='gKnlx'></bdo><ul id='gKnlx'></ul>

                          1. <small id='gKnlx'></small><noframes id='gKnlx'>

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

                            主站蜘蛛池模板: 日韩国产欧美一区 | 伊人精品视频 | 精品欧美一区二区三区 | 青久草视频 | 国产精品a免费一区久久电影 | 99国产精品99久久久久久 | 国产精品视频二区三区 | 特级做a爱片免费69 精品国产鲁一鲁一区二区张丽 | 在线观看视频福利 | 狠狠操婷婷 | 中文字幕 在线观看 | 国产精品精品视频一区二区三区 | 国产成人免费视频网站高清观看视频 | 亚洲二区在线 | 蜜桃免费一区二区三区 | 综合网在线| 在线免费观看毛片 | 国产午夜精品一区二区三区四区 | 欧美一区在线视频 | 91精品国产91久久久 | 久久99网 | 九九导航| 亚洲欧美一区二区三区情侣bbw | 在线一区 | 欧美一级片在线观看 | 亚洲精品电影在线观看 | 99av成人精品国语自产拍 | 特一级毛片| 欧美全黄| 欧美极品在线播放 | 日韩视频一区 | 中文字幕91| 国产午夜视频 | 五月天婷婷综合 | 欧美日韩久 | 欧美久久久电影 | 中文字幕在线视频精品 | 亚洲精品久久久久久久久久久 | 亚洲精品电影在线 | 欧美aaa| 综合久久综合久久 |