<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] # 通用Mapper [https://github.com/abel533/Mapper](https://github.com/abel533/Mapper) [https://github.com/abel533/Mapper/wiki/1.3-spring-boot](https://github.com/abel533/Mapper/wiki/1.3-spring-boot) 生成MyBatis單表的增刪改查 引入這個mybatis和jdbc都不需要了,他會引入進來 ~~~ <!-- https://mvnrepository.com/artifact/tk.mybatis/mapper-spring-boot-starter --> <dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>2.1.5</version> </dependency> ~~~ 然后繼承 ~~~ public interface UserMapper extends Mapper<User> { ~~~ ![](https://img.kancloud.cn/b3/0c/b30c40d6b4a8c0c72467978b74440d73_1916x1400.png) 用mybatis插件,第一次動態生成了 注意,這里要用他的掃描包,不能用springboot的 ~~~ @tk.mybatis.spring.annotation.MapperScan("com.Map") public class BootDemoApplication { ~~~ ~~~ # pojo別名掃描包 mybatis.type-aliases-package=com.pojo # 加載mybatis映射文件, 通用mapper不需要這個 # mybatis.mapper-locations=classpath:mapper/*Mapper.xml ~~~ 常見問題 [https://github.com/abel533/Mapper/wiki/faq](https://github.com/abel533/Mapper/wiki/faq) ~~~ @Data @Table(name = "User") //表名 public class User { @Id //import javax.persistence.Id; @KeySql(useGeneratedKeys = true) private Long id; private String username; @Transient //不是數據庫的字段 private String note; } ~~~ 然后使用就行 事務 ~~~ //事務 @Transactional //org.springframework.transaction.annotation.Transactional; public void insertUser(User user) { UserMapper.insert(user); } ~~~
                  <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>

                              哎呀哎呀视频在线观看