<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ### Fetch BeetlSQL提供了默認的3個注解用來獲取額外的對象,@FetchOne,@FetchMany,和@FetchSql。 開發者可以自定自己的Fetch注解,以FetchSql為例子 ```java public class CustomerOrder2 { @AutoID Integer id; String name; Integer customerId; @FetchSql("select * from sys_customer where id =#{customerId}") Customer customer; } ``` @FetchSql必須使用@Builder注解指明實現類 ```java @Retention(RetentionPolicy.RUNTIME) @Target(value = {ElementType.METHOD, ElementType.FIELD}) @Builder(FetchSqlAction.class) public @interface FetchSql { /** * sql模板語句 * @return */ String value(); } ``` FetchSqlAction實現了FetchAction接口,推薦繼承`AbstractFetchAction` ```java public interface FetchAction { public void execute(ExecuteContext ctx, List list); public void init(Class owner, Class target,Annotation config, PropertyDescriptor pd); public Annotation getAnnotation(); public PropertyDescriptor getOriginProperty(); } ``` execute方法是加載額外數據,list是sqlManager查詢的結果,Fetch操作需要遍歷list,獲取每一個數據庫查詢結果,然后根據init方法的配置,知道需要額外加載哪些屬性,比如CustomerOrder2對象的customer 實現FetchSql 需要考慮關鍵一點,就是確保如果對象已經被處理過,不需要加載額外數據了,免得無限嵌套循環,比如a加載b,b又加載a。AbstractFetchAction的queryFromCache會查詢FetchContext(一個上下文)是否已經處理過此對象,AbstractFetchAction的containAttribute方法則會從FetchContext查詢此對象的此屬性是否已經處理
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看