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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 概述 通用Mapper為我們提供了大量的對單表的CRUD方法.多表的還要我們自己寫. ## 導入包 github地址 :[https://github.com/abel533/Mapper](https://github.com/abel533/Mapper) ~~~ <dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>2.0.3</version> </dependency> ~~~ ## 繼承Mapper接口 ~~~ package com.like.mapper; import com.like.pojo.User; import tk.mybatis.mapper.common.Mapper; public interface UserMapper extends Mapper<User> //繼承此此接口,里面寫入我們的pojo { } ~~~ 通用Mapper為我們提供了這些方法,非常強大. ![](https://box.kancloud.cn/8fd23808a64e1094f84548a3290157b4_1770x1018.png) ## 通用Mapper的依賴 ![](https://box.kancloud.cn/d1ff734012d76f681469f06e78b68890_1144x918.png) 因為通用Mapper已經依賴了mybatis和spring-boot-staret-jdbc.所以我們不需要再次引入了. 而且通用Mapper也自動開啟了駝峰命名,所以我們也不需要手動開啟了. ## 通用Mapper的@MapperSan 因使用了通用Mapper,所以我們需要把啟動類上的@MapperSan注解替換為通用Mapper的@MapperSan ~~~ package com.like; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import tk.mybatis.spring.annotation.MapperScan; @SpringBootApplication @MapperScan("com.like.mapper") public class Application { public static void main(String[] args) { SpringApplication.run(Application.class); } } ~~~ ## 在pojo上使用通用Mapper 通用Mapper默認使用類名當做表名,如果類名不是表名,需要指定. 使用@Id標注主鍵,因為通用Mapper不知道主鍵是哪個字段,所以我們需要進行標注.
                  <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>

                              哎呀哎呀视频在线观看