1. 程式人生 > >springBoot整合mybatis的一些配置說明

springBoot整合mybatis的一些配置說明

1、在spring boot的配置檔案application.properties中,加入配置項:

mybatis.configuration.mapUnderscoreToCamelCase=true
 或
mybatis.configuration.map-underscore-to-camel-case=true

設為true表示開啟駝峰轉換。經過試驗,兩種配置方法都可以。但如果同時配置,前者mybatis.configuration.mapUnderscoreToCamelCase的優先順序更高

2、

#指定mapper.xml的位置
mybatis.mapper-locations=classpath:mapper/*.xml