# 该文件或application.properties会使用${}来filter属性配置,故Maven的filter需要使用@@引入属性配置以示区别
server:
port: 8080 # Server HTTP port.
servlet:
context-path: /myapp
context-parameters.*: # Servlet context init parameters.
application-display-name: myapp # Display name of the application.
tomcat:
max-connections: 10000 # Maximum number of connections that the server accepts and processes at any given time. Once the limit has been reached, the operating system may still accept connections based on the "acceptCount" property.
accept-count: 100 # Maximum queue length for incoming connection requests when all possible request processing threads are in use.
max-http-post-size: 2MB # Maximum size of the form content in any HTTP post request.
max-swallow-size: 2MB # Maximum amount of request body to swallow.
max-threads: 200 # Maximum amount of worker threads.
min-spare-threads: 10 # Minimum amount of worker threads.
port-header: X-Forwarded-Port # Name of the HTTP header used to override the original port value.
background-processor-delay: # Delay between the invocation of backgroundProcess methods. If a duration suffix is not specified, seconds will be used.
protocol-header: # Header that holds the incoming protocol, usually named "X-Forwarded-Proto".
protocol-header-https-value: https # Value of the protocol header indicating whether the incoming request uses SSL.
redirect-context-root: true # Whether requests to the context root should be redirected by appending a / to the path.
use-relative-redirects: # Whether HTTP 1.1 and later location headers generated by a call to sendRedirect will use relative or absolute redirects.
resource:
allow-caching: true # Whether static resource caching is permitted for this web application.
cache-ttl: # Time-to-live of the static resource cache.
uri-encoding: UTF-8 # Character encoding to use to decode the URI.e
remote-ip-header: # Name of the HTTP header from which the remote IP is extracted. For instance, `X-FORWARDED-FOR`.
basedir: # Tomcat base directory. If not specified, a temporary directory is used.
# relocate the static resources in /resources/ directory
spring:
datasource:
name: druidDataSource
type: com.alibaba.druid.pool.DruidDataSource
druid:
#############################################
# 配置 druid 数据源常见必要配置
#############################################
# mysql 数据库连接 URL 示例:jdbc:mysql://localhost:3306/your_db_name?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useLocalSessionState=true
# oracle 数据库连接的方式有 SID、Service Name、TNS、URL only 四种方式。
# SID:jdbc:oracle:thin:@localhost:1521:your_db_sid_name
# Service Name:jdbc:oracle:thin:@//localhost:1521/your_db_service_name
# 这里使用 SID 连接方式
url: jdbc:oracle:thin:@localhost:1521:ORCL
# driver-class-name 可配可不配,如果不配置,druid 会根据 url 自动识别 dbType,然后选择相应的 driverClassName。建议配置一下
# mysql 的驱动类建议使用 com.mysql.cj.jdbc.Driver
driver-class-name: oracle.jdbc.driver.OracleDriver
username: rosydawn
# 密文密码。执行java -cp druid-1.0.16.jar com.alibaba.druid.filter.config.ConfigTools you_password可创建公私钥及密文
password: W3yLWgRwgey3WlqA+wZcwnaB4HIGFVcZ9Aid1+mlhR5gDse+VgHSISsnNXRM54nPvFDiA2OhAh/+hzf1sJ0iFQ==
# 初始连接大小
initial-size: 10
# 最大连接大小
max-active: 50
# 最小连接数
min-idle: 10
#############################################
# druid 数据源其他配置
#############################################
# 是否缓存 preparedStatement,也就是 PSCache
# PSCache 对支持游标的数据库(如 Oracle)性能提升巨大,其他数据库配置为 false。分库分表较多的数据库,建议配置为 false
pool-prepared-statements: true
# 指定每个连接上 PSCache 的大小。去掉后监控界面sql无法统计
max-pool-prepared-statement-per-connection-size: 20
# 配置获取连接等待超时的时间,单位为毫秒
max-wait: 10000
# 验证连接可用与否的 SQL,可以通过以下三个以名称 test 开头属性配置何时进行检查。MySQL、SQL Server、SQL Server 的测试连接语句
# 可以使用 SELECT 1,oracle 可以使用 SELECT 1 FROM DUAL
validation-query: SELECT 1 FROM DUAL
# 申请连接时执行 validationQuery 检测连接是否有效,做了这个配置会降低性能
test-on-borrow: false
# 归还连接时执行 validationQuery 检测连接是否有效,做了这个配置会降低性能
test-on-return: false
# 空闲时时执行 validationQuery 检测连接是否有效。空闲时间大于 timeBetweenEvictionRunsMillis 的连接会被执行 validationQuery 是否有效
test-while-idle: true
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
time-between-eviction-runs-millis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
min-evictable-idle-time-millis: 30000
# 指定 validationQuery 的超时时间,单位是毫秒
validation-query-timeout: 3000
#########################################################################################################
# filters 通过逗号分隔别名列表的方式配置插件。注意,这种方式配置的插件使用的是默认配置。常用的插件有:
# stat,用于监控统计的 StatFilter;
# log4j、log4j2、slf4j、commonLogging 等表示使用日志记录 SQL 操作的 xxxFilter。如果这里要用,建议使用 slf4j(并依赖于 log4j2);
# wall,用于防止防御sql注入的 WallFilter;
# config,用于使用外部配置配置 ConfigFilter;
# mergeStat,使用带 SQL 合并功能的 MergeStatFilter。MergeStatFilter 是 mergeSql 属性为 true 的 StatFilter 子类。也可
# 以通过设置 connection-properties 属性包含 druid.stat.mergeSql=true 来打开 mergeSql 功能。
# 所有可用的别名映射配置信息参考 druid-xxx.jar!/META-INF/druid-filter.properties
# druid-spring-boot-starter 的新版和旧版在 filter 配置上有些不同。本配置文件所用的 druid-spring-boot-starter 版本
# 为 1.1.6,如果你发现使用本配置文件启动时 Druid 报错,请选择合适 druid-spring-boot-starter 的版本
#########################################################################################################
# filters: stat,config,slf4j,wall,mergeStat # 配置多个英文逗号分隔,filters 可以使用 connection-properties 属性来详细配置插件,但这种配置不够友好
filters: slf4j,config
# 既然使用了 filters 属性,那么也需要指定 connectionProperties 属性值为属性配置来源(可以为一个配置文件路径,或一个远程的HTTP配置文件的URL,或直接为英文分号分隔的配置列表)
# 这里在connection-properties中启用RSA解密(512字节),这里不配置公钥,而是使用默认的公钥
# Druid的ConfigTools每次加密的私钥会发生变化,但公钥默认不变。加密操作:java -cp druid-1.0.16.jar com.alibaba.druid.filter.config.ConfigTools you_password
connection-properties: druid.stat.slowSqlMillis=5000;druid.stat.mergeSql=true;config.decrypt=true;config.decrypt.key=${spring.datasource.druid.public-key}
public-key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKcWHH7onivVn9Ot6VfVap9Rdf5v6bxVZEP+7C9pufz3F89jCsQS7fXnbyTmXZFRZdbvA7JW4saEaWNLh3N4eRkCAwEAAQ==
# 相比 filters 属性配置仅能指定 Filter 的别名。filter 属性可以详细指定所用 Filter 的细节。建议使用 filter 属性代替 filters 属性
# 要想使自定义 Filter 配置生效需要将对应 Filter 的 enabled 设置为 true
filter: # 相当于 spring xml 配置中的 proxyFilters 属性
# 配置 ConfigFilter,其作用有:从配置文件中读取配置,从远程http文件中读取配置,为数据库密码提供加密功能
config:
enabled: true # 启用 ConfigFilter
# 配置 StatFilter,请参考 https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_StatFilter
stat:
enabled: true
db-type: AliOracle
# 是否显示慢 SQL
log-slow-sql: true
# 默认值为 3000 ms。StatFilter 属性 slowSqlMillis 用来配置 SQL 慢的标准,执行时间超过 slowSqlMillis 的就是慢
slow-sql-millis: 3000
# 是否合非参数化的 SQL,使统计更精准。也可以通过设置 connection-properties 属性包含 druid.stat.mergeSql=true 来打开此功能
merge-sql: true
# 默认为 false
connection-stack-trace-enable: true
# 配置 Slf4jLogFilter 以使用 sl4j 打印 SQL 日志
slf4j:
enabled: true
connection-log-enabled: true
# 配置 WallFilter,用于防御 SQL 注入攻击。它是基于 SQL 语法分析,理解其中的 SQL 语义,然后做处理的,智能,准确,误报率低
# 目前支持防御 mysql 和 oracle、sql server 的 SQL 注入攻击,下一步会支持postgres
wall:
enabled: true
# 配置数据库类型,将用于从jar包中对应的目录里加载拦截规则
db-type: oracle
# 定义详细的拦截配置
config:
# 指定禁用的变量列表,配合 variant-check 属性使用。有一些全局变量会暴露数据库信息,但有一些全局变量不得不使用。
# 在mysql中,目前全局变量使用白名单机制,在白名单内的全局变量才会被允许使用
deny-variants: USER,UID
############# 语句 拦截配置 #############
# 默认为 true。是否允许执行 SELECT 语句。注意!这里的属性名为 selelct,而不是 select
selelct-allow: true
# 默认为 true。是否允许执行 SELECT * FROM T 这样的语句。如果设置为 false,不允许执行 select * from t,但可是执行
# select * from (select id, name from t) a。这个选项是防御程序通过调用select *获得数据表的结构信息
select-all-column-allow: true
# 默认为 true。是否允许查询中使用 SELECT INTO 字句
select-into-allow: true
# 默认为 true。是否允许执行 INSERT 语句
insert-allow: true
# 默认为 true。是否允许执行 DELETE 语句
delete-allow: false
# 默认为 true。是否允许执行 UPDATE 语句
update-allow: true
# 默认为 true。是否允许执行 REPLACE 语句
replace-allow: true
# 默认为 true。是否允许执行 MERGE 语句,这个只在 Oracle 中有用
merge-allow: true
# 默认为 true。是否允许通过 jdbc 的 call 语法调用存储过程
call-allow: true
# 默认为 true。是否允许使用 SET 语法
set-allow: true
# 默认为 true。truncate 语句是危险,若需要自行关闭
truncate-allow: false
# 默认为 true。是否允许创建表
create-table-allow: false
# 默认为 true。是否允许执行 ALTER TABLE 语句
alter-table-allow: false
# 默认为 true。是否允许执行 DROP TABLE 语句
drop-table-allow: false
# 默认为 false。是否允许语句中存在注释,Oracle 的用户不用担心,Wall 能够识别 hints 和注释的区别
comment-allow: false
# 默认为 false。是否允许非以上基本语句的其他语句,通过这个选项就能够屏蔽 DDL
none-base-statement-allow: false
# 默认为 false。是否允许一次执行多条语句
multi-statement-allow: false
# 默认为 true。是否允许执行 mysql 的 use 语句
use-allow: true
# 默认为 true。是否允许执行 mysql 的 describe 语句
describe-allow: true
# 默认为 true。是否允许执行 mysql 的 show 语句
show-allow: true
# 默认为 true。是否允许执行 commit 操作
commit-allow: true
# 默认为 true。是否允许执行 rollback 操作
rollback-allow: true
############# 永真条件 拦截配置 #############
# 默认为 true。检查 SELECT 语句的 WHERE 子句是否是一个永真条件
select-where-alway-true-check: true
# 默认为 true。检查 SELECT 语句的 HAVING 子句是否是一个永真条件
select-having-alway-true-check: true
# 默认为 true。检查 DELETE 语句的 WHERE 子句是否是一个永真条件
delete-where-alway-true-check: true
# 默认为 false。检查 DELETE 语句是否无 where 条件,这是有风险的,但不是 SQL 注入类型的风险
delete-where-none-check: false
# 默认为 true。检查 UPDATE 语句的 WHERE 子句是否是一个永真条件
update-where-alay-true-check: true
# 默认为 false。检查 UPDATE 语句是否无 where 条件,这是有风险的,但不是 SQL 注入类型的风险
update-where-none-check: true
# 默认为 false。检查查询条件(WHERE/HAVING子句)中是否包含 AND 永真条件
condition-and-alway-true-allow: false
# 默认为 false。检查查询条件(WHERE/HAVING子句)中是否包含 AND 永假条件
condition-and-alway-false-allow: false
# 默认为 true。检查查询条件(WHERE/HAVING子句)中是否包含 LIKE 永真条件
condition-like-true-allow: true
############# 其他 拦截配置 #############
# 默认为 false。SELECT ... INTO OUTFILE 是否允许,这个是 mysql 注入攻击的常见手段
select-into-outfile-allow: false
# 默认为 true。检测 SELECT UNION
select-union-check: true
# 默认为 true。检测 SELECT MINUS
select-minus-check: true
# 默认为 true。检测 SELECT EXCEPT
select-except-check: true
# 默认为 true。检测 SELECT INTERSECT
select-intersect-check: true
# 默认为 false。是否必须参数化,如果为 True,则不允许类似 WHERE ID = 1 这种不参数化的 SQL
must-parameterized: false
# 默认为 true。是否进行严格的语法检测,Druid SQL Parser 在某些场景不能覆盖所有的 SQL 语法,出现解析 SQL 出错,可以临时
# 把这个选项设置为 false,同时把 SQL 反馈给 Druid 的开发者
strict-syntax-check: true
# 默认为 false。查询条件中是否允许有 XOR 条件。XOR 不常用,很难判断永真或者永假
condition-op-xor-allow: false
# 默认为 true。查询条件中是否允许有"&"、"~"、"|"、"^"运算符
condition-op-bitwse-allow: true
# 默认为 false。查询条件中是否允许连续两个常量运算表达式
condition-double-const-allow: false
# 默认为 true。是否允许 SELECT * FROM A MINUS SELECT * FROM B 这样的语句
minus-allow: true
# 默认为 true。是否允许 SELECT * FROM A INTERSECT SELECT * FROM B 这样的语句
intersect-allow: true
# 默认为 true。拦截常量运算的条件,比如说 WHERE FID = 3 - 1,其中 "3 - 1" 是常量运算表达式
const-arithmetic-allow: true
# 默认为 false。是否允许 limit 0 这样的语句
limit-zero-allow: false
# 默认为 -1。配置最大返回行数,如果 select 语句没有指定最大返回行数,会自动修改 select 添加返回限制
select-limit: -1
############# 禁用对象检测配置 #############
# 默认为 true。检测是否使用了禁用的表
table-check: true
# 默认为 true。检测是否使用了禁用的 Schema
schema-check: true
# 默认为 true。检测是否使用了禁用的函数
function-check: true
# 默认为 true。检测是否使用了“禁用对对象”
object-check: true
# 默认为 true。检测是否使用了“禁用的变量”
variant-check: true
# 默认为空。指定只能只读的表,不能够在 SELECT INTO、DELETE、UPDATE、INSERT、MERGE 中作为"被修改表"出现
#read-only-tables:
# 默认情况下,配置装载的目录为 druid jar包中对应的“META-INF/druid/wall/db-type”目录,根据 db-type 属性自动定位,
# druid 会从配置目录中以下文件中读取一系列名为 deny-xxx.txt 的配置文件
#dir: META-INF/druid/wall/oracle
############# Jdbc相关配置 #############
# 默认为 true。是否允许调用 Connection.getMetadata方法,这个方法调用会暴露数据库的表信息
metadata-allow: false
# 默认为 true。是否允许调用 Connection/Statement/ResultSet 的 isWrapFor 和 unwrap 方法,这两个方法调用,使得有办法
# 拿到原生驱动的对象,绕过 WallFilter 的检测直接执行 SQL
wrap-allow: true
# 监控配置
web-stat-filter: # 监控 WebStatFilter 配置,说明请参考 https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_%E9%85%8D%E7%BD%AEWebStatFilter
enabled: true
url-pattern: /*
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
# session-stat-enable:
# session-stat-max-count:
# principal-session-name:
# principal-cookie-name:
# profile-enable:
stat-view-servlet: # StatViewServlet配置,说明请参考 https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_StatViewServlet%E9%85%8D%E7%BD%AE
# 是否启用 StatViewServlet(监控页面)默认值为 false(考虑到安全问题默认并未启动,如需启用建议设置密码或白名单以保障安全)
# druid-spring-boot-starter 1.1.10 以后的版本需要指定为 true 不然默认是关闭的就会出现404
enabled: true
reset-enable: false
url-pattern: /druid/*
login-username: admin
login-password: admin
# 添加 IP 白名单,建议通过权限管理框架,如 Spring Security 或 Shiro 来设置哪些用户可以访问监控页面
#allow:
# 添加 IP 黑名单,当白名单和黑名单重复时,黑名单优先级更高
#deny:
# 默认多个 DruidDataSource 的监控数据是各自独立的,在 Druid-0.2.17 版本之后,支持配置公用监控数据
#use-global-data-source-stat: true
# Spring监控配置
aop-patterns: com.rosydawn.demo # Spring监控AOP切入点,如x.y.z.service.*,配置多个英文逗号分隔
#############################################
# spring mvc 配置
#############################################
mvc:
static-path-pattern: /resources/**
thymeleaf:
enabled: true
prefix: classpath:/templates/
mode: HTML
suffix: .html
encoding: UTF-8
cache: false
http:
log-request-details: true
#############################################
# Spring Security 配置
#############################################
# security:
# filter:
# Security filter chain order
# order: -100
# Security filter chain dispatcher types
# dispatcher-types: async,error,request
#############################################
# Spring Session 配置
#############################################
session:
# 支持jdbc、redis、hazelcast、mongodb以及none(表示禁用spring session)
store-type: jdbc
# 设置会话超时时间。If a duration suffix is not specified, seconds are used。
# 如果未设置timeout,则自动化配置会去使用server.servlet.session.timeout的值
timeout: 1800s
servlet:
# Session repository filter order
filter-order: -2147483598
# Session repository filter dispatcher types
filter-dispatcher-types: async,error,request
jdbc:
# # Name of the database table used to store sessions
table-name: TB_AI_LEARN_SESSION
# 用于创建的数据库schema(用于存储会话)的SQL文件路径。规范起见,我们手动创建会话相关表(自定义会话相关表的表名),而不
# 是使用spring session自带的sql文件建表
# schema: classpath:org/springframework/session/jdbc/schema-@@platform@@.sql
# 会话超时清理的Cron表达式
cleanup-cron: 0 */30 * * * ?
# 数据源的初始化方式,支持:
# embedded(默认,仅初始化嵌入式数据库(HSQL、H2和Derby)的数据源,即使用spring session自带的sql文件创建表)
# always(总是初始化数据源),
# never(不初始化数据源,需手动创建会话相关表,JdbcHttpSessionConfiguration中会优先获取SpringSessionDataSource,如
# 果找不到(initialize-schema为never),则使用其他DataSource的Bean)
initialize-schema: never
#############################################
# Spring devtools 配置
#############################################
devtools:
# Whether to enable development property defaults
add-properties: true
livereload:
# Whether to enable a livereload.com-compatible server
enabled: true
# Server port
port: 35729
restart:
# Whether to enable automatic restart
enabled: true
additional-exclude: null
additional-paths: null
# Patterns that should be excluded from triggering a full restart
exclude: META-INF/maven/**,META-INF/resources/**,resources/**,static/**,public/**,templates/**,**/*Test.class,**/*Tests.class,git.properties,META-INF/build-info.properties
# Whether to log the condition evaluation delta upon restart
log-condition-evaluation-delta: true
# Amount of time to wait between polling for classpath changes
poll-interval: 1s
# Amount of quiet time required without any classpath changes before a restart is triggered
quiet-period: 400ms
# Name of a specific file that, when changed, triggers the restart check. If not specified, any classpath file change triggers the restart
# trigger-file:
#############################################
# Spring Test 配置
#############################################
# test:
# database:
# Determines what type of existing DataSource beans can be replaced. It Can be
# any(default value): Replace any DataSource bean (auto-configured or manually defined)
# auto_configured: Only replace auto-configured DataSource
# none: Don't replace the application default DataSource
# replace: any
# mockmvc:
# MVC Print option. It can be:
# system_out: Print MVC interactions to {@code System.out}
# none: Do not print MVC interactions
# default: Use the default print setting ({@code MockMvcPrint.SYSTEM_OUT} unless explicitly overridden)
# log_debug: Log MVC interactions at the {@code DEBUG} level
# system_err: Print MVC interactions to {@code System.err}
# print: system_out
#############################################
# quartz 相关配置,也可以通过创建 SchedulerFactoryBeanCustomizer(可自定义 SchedulerFactoryBean) bean 来配置。参考 https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-quartz
#############################################
quartz:
properties: # 配置额外的属性
org:
quartz:
scheduler:
instanceName: facelibScheduler # 调度器实例名称
instanceId: AUTO # 调度器实例编号自动生成
jobStore:
class: org.quartz.impl.jdbcjobstore.JobStoreTX # 持久化方式配置
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # 持久化方式配置数据驱动,MySQL 数据库
tablePrefix: TB_MYAPP_ # quartz相关数据表前缀名
isClustered: true # 开启分布式部署
clusterCheckinInterval: 10000 # 分布式节点有效性检查时间间隔,单位:毫秒
useProperties: false # 配置是否使用
threadPool:
class: org.quartz.simpl.SimpleThreadPool # 线程池实现类
threadCount: 10 # 执行最大并发线程数量
threadPriority: 5 # 线程优先级
threadsInheritContextClassLoaderOfInitializingThread: true # 配置是否启动自动加载数据库内的定时任务,默认为 true
# 将定时任务存储在数据库中后,最多只有一个应用实例执行定时任务,为防止集群环境下多机重复执行定时任务,故设置为 jdbc。
# 一旦设置为 jdbc,如果存在一个 DataSource Bean 就可以将定时任务配置存储到数据库中了。也可单独为 quartz 创建一个专用的 Datasource bean(在其 @Bean 方法上使用 @QuartzDataSource 注解)
job-store-type: jdbc # 可以为jdbc、memory,默认为 memory。
jdbc:
# 设置定时任务相关表的初始化模式,可以为 always,embedded,never,默认为 embedded,即使用 quartz 包自带的标准脚本(classpath:org/quartz/impl/jdbcjobstore/tables_@@platform@@.sql)在每次重启时初始化定时任务相关表。
# 这里我们手动创建定时任务相关表并复用 druid 数据源,不指定初始化相关脚本,故这里设置为 never。当然也可以编写自己的sql脚本来初始化定时任务相关表。
initialize-schema: never
# schema: classpath:org/quartz/impl/jdbcjobstore/tables_@@platform@@.sql
scheduler-name: # Name of the scheduler.
auto-startup: true # Whether to automatically start the scheduler after initialization.
startup-delay: 1s # Delay after which the scheduler is started once initialization completes. Setting this property makes sense if no jobs should be run before the entire application has started up.
# By default, jobs created by configuration will not overwrite already registered jobs that have been read from a persistent job store. Set this property to true to enable overwriting existing job definitions
overwrite-existing-jobs: true # 一般我们会在修改配置文件重启后希望定时任务发生更新,故这里设置为 true
wait-for-jobs-to-complete-on-shutdown: false # Whether to wait for running jobs to complete on shutdown.
#############################################
# Mybatis 配置
#############################################
#mybatis:
# config-location=classpath: mybatis/mybatis-config.xml
# mapper-locations=classpath: mybatis/mapper/*.xml
#############################################
# Mybatis Pagehelper 配置
#############################################
pagehelper:
# 默认情况下会使用 PageHelper 方式进行分页,如果想要实现自己的分页逻辑,可以实现 Dialect(com.github.pagehelper.Dialect) 接
# 口,然后配置该属性为实现类的全限定名称
# dialect: com.my.dialect
####### 下面几个参数都是针对默认 dialect 情况下的参数。使用自定义 dialect 实现时,下面的参数没有任何作用 #######
# 分页插件会自动检测当前的数据库链接,自动选择合适的分页方式。你可以配置 helperDialect 属性来指定分页插件使用哪种方言
# 配置时,可以使用下面的缩写值:oracle,mysql,mariadb,sqlite,hsqldb,postgresql,db2,sqlserver,informix,h2,sqlserver2012,derby
# 使用 SqlServer2012 数据库时,需要手动指定为 sqlserver2012,否则会使用 SqlServer2005 的方式进行分页
# 你也可以实现 AbstractHelperDialect,然后配置该属性为实现类的全限定名称即可使用自定义的实现方法
helper-dialect: oracle
# 默认值为 false,该参数对使用 RowBounds 作为分页参数时有效。当该参数设置为 true 时,会将 RowBounds 中的 offset 参数当成
# pageNum 使用,可以用页码和页面大小两个参数进行分页
offset-as-page-num: false
# 默认值为 false,该参数对使用 RowBounds 作为分页参数时有效。当该参数设置为 true 时,使用 RowBounds 分页会进行 count 查询
row-bounds-with-count: false
# 默认值为 false,当该参数设置为 true 时,如果 pageSize=0 或者 RowBounds.limit = 0 就会查询出全部的结果(相当于没有执行分页
# 查询,但是返回结果仍然是 Page 类型)
page-size-zero: false
# 分页合理化参数,默认值为 false。当该参数设置为 true 时,pageNum<=0 时会查询第一页, pageNum>pages(超过总数时),会查询最
# 后一页。默认 false 时,直接根据参数进行查询
reasonable: false
# 为了支持 startPage(Object params)方法,增加了该参数来配置参数映射,用于从对象中根据属性名取值,可以配置 pageNum,pageSize,
# count,pageSizeZero,reasonable,不配置映射的用默认值,默认值为:
# pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero
params: count=countSql
# 支持通过 Mapper 接口参数来传递分页参数,默认值 false,分页插件会从查询方法的参数值中,自动根据上面 params 配置的字段中取值,
# 查找到合适的值时就会自动分页。使用方法可以参考测试代码中的 com.github.pagehelper.test.basic 包下的 ArgumentsMapTest 和
# ArgumentsObjTest
support-methods-arguments: false
# 默认值为 false。设置为 true 时,允许在运行时根据多数据源自动识别对应方言的分页(不支持自动选择sqlserver2012,只能使用
# sqlserver)
auto-runtime-dialect: false
# 默认值为 true。当使用运行时动态数据源或没有设置 helperDialect 属性自动获取数据库类型时,会自动获取一个数据库连接,通过该属性
# 来设置是否关闭获取的这个连接,默认 true 关闭,设置为 false 后,不会关闭获取的连接,这个参数的设置要根据自己选择的数据源来决定
closeConn: true
dialect-alias: null
default-count: null
# 默认值为 true。如果没有设置 helper-dialect 的值或 auto-runtime-dialect 设置为 false 时且当该属性设置为 true 时,则会自动获取
# dialect(根据 jdbcUrl 获取数据库方言);在设置了 helper-dialect 的值或 auto-runtime-dialect 设置为 true 时,auto-dialect
# 即使设置为 true,也会自动为 false 而无效
auto-dialect: true
网友评论