Ourbatis系列文章:
以Spring Boot项目为例,添加一下依赖
<dependency>
<groupId>com.smallnico</groupId>
<artifactId>ourbatis-spring-boot-starter</artifactId>
<version>1.0.5</version>
</dependency>
然后配置一下您的实体类所在的包路径:
ourbatis.domain-locations=org.nico.ourbatis.domain
如果您想查看Ourbatis启动日志,您可以追加以下配置:
logging.level.org.nico.ourbatis=debug
接下来,您的Mapper只需要继承SimpleMapper接口即可:
public interface UserMapper extends SimpleMapper<User, Integer>{}