标签:and path nbsp mapper type includes pre false ring
springboot的mybatis依赖
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
指定项目中java目录可以配置xml,如果不配置则会默认配置在 src/main/resources下
<resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.yml</include> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.yml</include> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource>
yml文件中配置mybatis对应的xml文件路径,不配置会造成mapper与xml绑定不了
mybatis: # 数据库映射实体类包路径 type-aliases-package: top.xzhand.po mapper-locations: classpath*:top/xzhand/mapper/impl/*.xml
# 表中的字段名与对象的属性名下划线和驼峰转换
configuration:
map-underscore-to-camel-case: true
标签:and path nbsp mapper type includes pre false ring
原文地址:https://www.cnblogs.com/notmore/p/11690996.html