springboot集成mybatis的步骤---小白勿喷

1.在pom.xml中添加依赖:

             
   org.mybatis.spring.boot
   mybatis-spring-boot-starter
   1.1.1

2.在配置文件中添加mybatis的配置文件:

 mybatis.mapper-locations=classpath:mybatis/*.xml

3.在springboot的启动项中添加扫描dao层的注解,不然会报错:

 @MapperScan("com.spring.boot.dao")//扫描:该包下相应的class,主要是MyBatis的持久化类.



你可能感兴趣的:(springboot集成mybatis的步骤---小白勿喷)