Mybatis常用配置(2)

1 mybatis-plus:
 2   # mapper配置文件路径
 3   mapper-locations: classpath:mybatis/mapper/*Mapper.xml
 4   # 数据库对应对象实例包
 5   type-aliases-package: com.zsm.model
 6   configuration:
#开启驼峰命名功能
map-underscore-to-camel-case: true
7 #全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true 8 cache-enabled: true 9 #mybatis-plus配置控制台打印完整带参数SQL语句,用于debug调试查看完整查询SQL 10 log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 11 global-config: 12 #刷新mapper Debug调试修改XML后自动刷新 13 refresh-mapper: true 14 #缓存 Sql 解析,默认不缓存 15 sql-parser-cache: true 16 #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID",ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; 17 #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; 18 id-type: 2 19 #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" 20 #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" 21 field-strategy: 2 22 #驼峰下划线转换(作用同上) 23 db-column-underline: true 24 #数据库大写下划线转换 25 capital-mode: true 26 #序列接口实现类配置,自定义序列化实现类 27 key-generator: com.zsm.springboot.xxx 28 #逻辑删除配置 29 logic-delete-value: 0 30 logic-not-delete-value: 1 31 #自定义SQL注入器 32 sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector 33 #自定义填充策略接口实现 34    meta-object-handler: com.zsm.springboot.xxx

   如果有单独的MyBatis配置,可将其路径配置到application.yml中。

mybatis-plus:
  configuration:
  config-location: classpath:mybatis-config.xml 
  #如果有单独的mybatis配置,就可以将路径配置在ConfigLocation中

  备注:单独的MyBatis配置见上一篇“MyBatis常用配置”.

posted @ 2020-06-15 09:43  FardlyP  阅读(208)  评论(0)    收藏  举报