美文网首页
MyBatis的使用

MyBatis的使用

作者: 矢量演说 | 来源:发表于2020-05-17 23:09 被阅读0次
  • 官方文档合集

MyBatis官方文档
MyBatis-plus官方文档

<!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter -->
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core -->
<dependency>
    <groupId>org.mybatis.generator</groupId>
    <artifactId>mybatis-generator-core</artifactId>
    <version>1.3.7</version>
</dependency>

  • 运行时执行SQL文件

SpringBoot2.0版本以上的要在yml配置上加上initialization-mode: always才可以执行SQL文件。
注意这里冒号后面不要加空格!!用完以后注释掉,否则一直要自己建。


yml配置

相关文章

网友评论

      本文标题:MyBatis的使用

      本文链接:https://www.haomeiwen.com/subject/hpadohtx.html