久久久久久久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 - 多對一關(guān)系

        Spring Data JDBC - Many-to-One Relationship(Spring Data JDBC - 多對一關(guān)系)
        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 - 多對一關(guān)系的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我似乎在網(wǎng)上找不到任何關(guān)于在 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;
                      }
                  

                  創(chuàng)建的查詢?nèi)缦滤?我正在尋找更多相反的東西,其中 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.

                  我可以確認(rèn)它不受支持.多對一關(guān)系跨越聚合的邊界.跨聚合的引用必須建模為被引用聚合的 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 將把引用視為一對一關(guān)系和同一聚合的一部分,這將對多對一關(guān)系產(chǎn)生你不想要的影響,例如當(dāng)被引用的實體被刪除時,被引用的實體被刪除.這對于同一聚合中的一對一關(guān)系是正確的.

                  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.

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

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

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

                  相關(guān)文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個隨機打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?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>

                            主站蜘蛛池模板: 日日夜夜天天 | 欧美日韩国产一区二区三区 | 亚洲欧美一区二区三区视频 | 午夜免费成人 | 国产精品日日夜夜 | 亚洲第一成年免费网站 | 97精品国产一区二区三区 | 狠狠婷婷综合久久久久久妖精 | 国产精品久久久久9999鸭 | 亚洲精彩免费视频 | 国产精品一区二区久久 | 久久99精品久久久久久噜噜 | 天天操夜夜操免费视频 | 狠狠干狠狠操 | 中文字幕的av | 亚洲欧洲日韩精品 中文字幕 | 国产精品久久久久久av公交车 | 亚洲精品1区 | 日韩视频在线一区 | 日韩电影一区二区三区 | 成人国产免费视频 | 精品国产18久久久久久二百 | 亚洲欧美视频一区 | 91精品国产综合久久久动漫日韩 | 亚洲视频免费在线观看 | 在线日韩av电影 | 成人国产在线视频 | 在线观看成人小视频 | 午夜欧美一区二区三区在线播放 | 18av在线播放| 欧美精品一区二区三区蜜臀 | 亚洲福利在线观看 | 国产美女黄色片 | 日韩视频一区在线观看 | 99re6在线| 色婷婷av777 av免费网站在线 | 欧美色性 | 亚洲精品中文字幕中文字幕 | 婷婷二区| 亚洲日韩中文字幕一区 | 国产在线观看不卡一区二区三区 |