在官网找了很久没看到有关于spring boot跟mybatis的整合,求高手指点
官方版本没有提供支持,好像只能使用原始的方法整合了
完整参考:http://blog.csdn.net/xiaoyu411502/article/details/48164311
添加yml里面的配置:
mybatis:
typeAliasesPackage: com.wxj.entity
mapperLocations: classpath:mapper/*.xml
添加依赖
<dependency>
<!-- mybatis -->
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.0</version>
</dependency>
启动类添加注解:@MapperScan("com.wxj.dao")
如果你对mybatis很熟悉的话 剩下的就不需要我多说 了。