<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 功能強大 支持多語言、二開方便! 廣告
                ~~~ package net.youworker.domain; import net.youworker.repository.CustomerRepository; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import java.util.List; @RunWith(SpringRunner.class) @SpringBootTest public class jpqlTest { @Autowired private CustomerRepository customerRepository; /** * 通過用戶名查詢 */ @Test public void testFindByName() { Customer customer = customerRepository.findByName("大腳"); System.out.println(customer); } /** * 通過用戶名和id查詢 */ @Test public void testFindByNameAndId() { Customer customer = customerRepository.findByNameAndId("大腳",3l); System.out.println(customer); } /** * 通過jpql的更新操作 * springDataJpa中使用jpql完成 更新/刪除操作 * 需要手動添加事務的支持 * 默認會執行結束之后,回滾事務(前提:數據庫表引擎必須支持事務) * * @Rollback 設置是否自動回滾,默認回滾 * false 不自動回滾 * true 自動回滾 */ @Test @Transactional //添加事務的支持 @Rollback(value = false) public void testUpdateCustomer() { customerRepository.updateCustName(3l,"謝大腳"); System.out.println("使用jpql進行更新操作"); } /** * 原生sql語句操作 * */ @Test public void testFindBySQL() { List<Customer> obj = customerRepository.findBySQL(); for (int i = 0; i < obj.size(); i++) { System.out.println(obj.get(i).getCustName()); } } } ~~~
                  <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>

                              哎呀哎呀视频在线观看