
ngweijin.quickboot-mybatis-plus.1.0.40.source-code.application-quickboot.yml Maven / Gradle / Ivy
spring:
datasource:
driver-class-name: org.h2.Driver
# 以本地文件存储数据的方式使用H2数据库。
# ./h2/test 在项目根路径下保存数据库文件
# AUTO_SERVER=true 启动自动混合模式,允许开启多个连接,该参数不支持在内存中运行模式
# DB_CLOSE_ON_EXIT 当虚拟机退出时并不关闭数据库
url: jdbc:h2:file:./h2/quickboot;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;MODE=MYSQL
# jdbc:h2:file:C:/h2/quickboot;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;MODE=MYSQL
# 以内存方式使用数据库(这里会创建一个数据库名为 test 的数据库实例)
# MODE=MYSQL 兼容模式
# url: jdbc:h2:mem:test;MODE=MYSQL
username: sa
password:
h2:
console:
# 是否允许网页访问,默认false
enabled: true
# h2数据库的访问路径:http://localhost:8080/h2(默认为/h2-console)
path: /h2
settings:
# 是否允许从其他地方访问,还是只允许从本地访问
web-allow-others: true
# flyway在spring boot中默认配置位置为:classpath:db/migration
# flyway命名规则为:V__.sql (with an underscore-separated version, such as ‘1’ or ‘2_1’)
flyway:
# 默认不启用,true 为启用
enabled: true
baseline-on-migrate: true
locations:
- classpath:db/migration/h2
# - classpath:db/migration/mysql
# - classpath:db/migration/oracle
devtools:
restart:
#热部署开关, 和mybatis-plus枚举扫描冲突,这里不开启
enabled: false
decorator:
datasource:
enabled: true
p6spy:
# Register P6LogFactory to log JDBC events
enable-logging: true
# Use com.p6spy.engine.spy.appender.MultiLineFormat instead of com.p6spy.engine.spy.appender.SingleLineFormat
multiline: true
# Use logging for default listeners [slf4j, sysout, file]
logging: slf4j
# Log file to use (only with logging=file)
#log-file: spy.log
# Custom log format, if specified com.p6spy.engine.spy.appender.CustomLineFormat will be used with this log format
#log-format:
tracing:
include-parameter-values: true
# mybatis-plus
mybatis-plus:
# MyBatis Mapper 所对应的 XML 文件位置,如果您在 Mapper 中有自定义方法(XML 中有自定义实现),需要进行该配置,告诉 Mapper 所对应的 XML 文件位置。
mapper-locations: classpath*:/mapper/**/*.xml
# 配置扫描通用枚举,支持统配符 * 或者 ; 分割,如果配置了该属性,会将路径下的枚举类进行注入,让实体类字段能够简单快捷的使用枚举属性
#type-enums-package: com.mwj.cms.common.enums
global-config:
# 打印mybatis-plus的logo
banner: false
db-config:
# 是否开启 LIKE 查询,即根据 entity 自动生成的 where 条件中 String 类型字段 是否使用 LIKE,默认不开启。
#column-like: false
# 全局默认主键生成策略类型。默认值ASSIGN_ID
id-type: ASSIGN_ID
# 表名、是否使用下划线命名,默认数据库表使用下划线命名
table-underline: true
# 是否开启大写命名,默认不开启
capital-mode: false
#全局逻辑删除字段值 3.3.0开始支持。
logic-delete-field: deleted
# 逻辑已删除值,(逻辑删除下有效)
logic-delete-value: 1
# 逻辑未删除值,(逻辑删除下有效)
logic-not-delete-value: 0
configuration:
# MyBatis 在使用 resultMap 来映射查询结果中的列,如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段,
# 这就导致在调用到该字段的时候由于没有映射,取不到而报空指针异常。
call-setters-on-nulls: true
# 对JavaBean中属性开启自动驼峰命名规则(camel case)映射,默认对返回类型为Map的对象的key不起作用,所以需要使用自定义MybatisMapWrapperFactory类来处理
map-underscore-to-camel-case: true
© 2015 - 2025 Weber Informatics LLC | Privacy Policy