springboot集成mybatis
所属分类 mybatis
浏览量 1251
pom里增加依赖
org.mybatis.spring.boot
mybatis-spring-boot-starter
1.3.2
mybatis-spring-boot-starter-1.3.2.jar
mybatis-spring-boot-autoconfigure-1.3.2.jar
mybatis-3.4.6.jar
mybatis-spring-1.3.2.jar
https://github.com/mybatis/spring-boot-starter/releases/tag/mybatis-spring-boot-1.3.2
MyBatis integration with Spring Boot
MyBatis Spring-Boot-Starter will help you use MyBatis with Spring Boot
http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure
https://github.com/mybatis/spring-boot-starter/wiki/Quick-Start
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): demo.dao.UserDao.getById
statement = mapper类名 + 方法 = namespace + id
mapper namespace 与 mapper类名 保持一致
mybatis.mapper-locations=classpath:mapper/*.xml
package demo.dao;
@Mapper
public interface UserDao
mapper namespace="demo.dao.UserDao"
例子代码
https://gitee.com/dyyx/springboothello
mybatis独立使用(不依赖spring)
上一篇
下一篇
java面试题合集
单例模式几种实现方式
Mybatis工作原理简介
spring-boot-starter原理
top使用技巧
netty4耗时业务处理实例