基于SpringBoot的影像注册系统03 如何集成MybatisPlus?(视频)

步骤 1  pom.xml


    com.baomidou
    mybatis-plus-boot-starter
    3.3.1.tmp

导入mybatis-plus的依赖

步骤 2  application.yml

mybatis-plus:
  mapper-locations: classpath:mybatis/*.xml
  type-aliases-package: com.app.bean
  configuration:
    map-underscore-to-camel-case: false

mybatis默认是属性名和数据库字段名一一对应的,即 
数据库表列:user_name 
实体类属性:user_name

但是java中一般使用驼峰命名 
数据库表列:user_name 
实体类属性:userName

这边设置成false是因为数据库字段和bean的字段本来就是一样的(为了偷懒和减少出错)

 

最后是视频讲解:

SpringBoot影像资料注册系统-mybatisplus集成 - 知乎SpringBoot影像资料注册系统-mybatisplus集成https://www.zhihu.com/zvideo/1442084748626161664

你可能感兴趣的:(spring,boot,java,intellij-idea)