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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ~~~ package net.youworker.repository; import net.youworker.domain.Customer; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import java.util.List; /** * 符合 SpringDataJpa的dao層接口規范 * JpaRepository<操作的實體類類型,實體類中主鍵屬性的類型> * 封裝了基本的CRUD操作 * JpaSpecificationExecutor<操作的實體類類型> * 封裝了復雜查詢(如分頁等) * * @author: hcf * @qq: 46914685 * @email: 46914685@qq.com * @date: 2020-01-07 10:47 */ public interface CustomerRepository extends JpaRepository<Customer, Long>, JpaSpecificationExecutor<Customer> { /** * 根據客戶名稱查詢客戶 * 使用jpql的形式查詢 * jpql: from Customer wher custName = ? * 配置jpql語句,使用@Query注解 */ @Query(value = "from Customer where custName = ?1") public Customer findByName(String custName); /** * 根據客戶名稱和id客戶id查詢客戶 * jpql: from Customer where custName=?1 and custId=?2 * 對于多個占位符參數 * 賦值的時候,默認的情況下,占位符的位置需要和方法參數中的位置保持一致 * 可以指定點位符參數的位置 * ?+索引的方式,指定此占位符的取值來源 */ @Query("from Customer where custName=?1 and custId=?2") public Customer findByNameAndId(String name, Long id); /** * 使用jpql完成更新操作 * 根據id更新客戶的名稱 * <p> * sql: update cst_customer set cust_name =? where cust_id = ? * jpql: update Customer set custName =?2 where custId=?1 * * @Query 代表的是進行查詢 * * @Modifying 聲明此方法是用來進行更新操作 * 當前執行的是一個更新操作 */ @Query("update Customer set custName =?2 where custId=?1") @Modifying public void updateCustName(long id, String name); /** * 使用原生sql操作 * 查詢全部的客戶 * sql: select * from cst_customer; * 使用@Query 配置sql查詢 * value: sql語句 * nativeQuery: 查詢方式 * true: sql 查詢 * false: jpql 查詢 */ @Query(value = "select * from cst_customer",nativeQuery = true) // public List<Object []>findBySQL(); public List<Customer>findBySQL(); } ~~~
                  <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>

                              哎呀哎呀视频在线观看