<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] # Repository分析 創建的 Repository 只要繼承 JpaRepository 即可,就會幫我們?動?成很多內置?法 ?如 ?ndByUserName 會?動?產?個以 userName 為參數的查詢 ?法,?如 ?ndAll 會?動查詢表??的所有數據等 ![](https://img.kancloud.cn/bb/93/bb933c45537b49ce54c08f6d25bf579d_656x609.png) 發現 JpaRepository 繼承 PagingAndSortingRepository 和 QueryByExampleExecutor, PagingAndSortingRepository 類主要負責排序和分?頁內容, QueryByExampleExecutor 提供了很多示例的查 詢?法,如下: ~~~ public interface QueryByExampleExecutor<T> { <S extends T> S findOne(Example<S> example); //根據“實例”查找?個對象 <S extends T> Iterable<S> findAll(Example<S> example); //根據“實例”查找?批對 象 <S extends T> Iterable<S> findAll(Example<S> example, Sort sort); //根據“實例” 查找?批對象,且排序 <S extends T> Page<S> findAll(Example<S> example, Pageable pageable); //根據“ 實例”查找?批對象,且排序和分? <S extends T> long count(Example<S> example); //根據“實例”查找,返回符合條件的對象 個數 <S extends T> boolean exists(Example<S> example); //根據“實例”判斷是否有符合條件的對象 } ~~~ 繼承 JpaRepository 的會?動擁有上述這些?法和排序、分?頁功能。查看源碼我們發現 PagingAndSortingRepository ?繼承了 CrudRepository。CrudRepository 的源碼如下 ~~~ @NoRepositoryBean public interface CrudRepository<T, ID> extends Repository<T, ID> { <S extends T> S save(S entity); <S extends T> Iterable<S> saveAll(Iterable<S> entities); Optional<T> findById(ID id); boolean existsById(ID id); Iterable<T> findAll(); Iterable<T> findAllById(Iterable<ID> ids); long count(); void deleteById(ID id); void delete(T entity); void deleteAll(Iterable<? extends T> entities); void deleteAll(); } ~~~ 從 CrudRepository 的源碼可以看出 CrudRepository 內置了我們最常?的增、刪、改、查的?法,?便我們 去使?,因為 JpaRepository 繼承了 PagingAndSortingRepository,PagingAndSortingRepository 繼承了 CrudRepository,所以繼承 JpaRepository 的類也默認擁有了上述?法
                  <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>

                              哎呀哎呀视频在线观看