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 协议》,转载必须注明作者和本文链接
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 1

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

4年前 评论

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