mybatis 配置

设置项

所有项目中用到的配置建议全部在mybatis-config.xml中显示配置,否则版本升级后,如果官方的默认配置变了,将对程序造成不可预知的影响

说明 setting discription valid values defualt
设置自增主键 useGeneratedKeys Allows JDBC support for generated keys. A compatible driver is required. This setting forces generated keys to be used if set to true, as some drivers deny compatibility but still work (e.g. Derby). true | false false
设置默认的执行器类型,如果使用批量插入sql,需要在单独的insert标签上配置 defaultExecutorType Configures the default executor. SIMPLE executor does nothing special. REUSE executor reuses prepared statements. BATCH executor reuses statements and batches updates. SIMPLE REUSE BATCH SIMPLE
日志前缀配置,配置后与logback中的logger=name对应 logPrefix Specifies the prefix string that MyBatis will add to the logger names. Any String Not set
默认的日志实现,配置后支持自动发现,标准都使用SLF4j,没有配置则使用mybatis自己的console输出 logImpl If this setting is not present logging implementation will be autodiscovered. SLF4J | LOG4J | LOG4J2 | JDK_LOGGING |COMMONS_LOGGING|STDOUT_LOGGING |NO_LOGGING Not set
本作品采用《CC 协议》,转载必须注明作者和本文链接
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 1

懵了,Mybaits??能出Laravel版???

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!