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 协议》,转载必须注明作者和本文链接
懵了,Mybaits??能出Laravel版???