其他分享
首页 > 其他分享> > springboot通用mapper配置

springboot通用mapper配置

作者:互联网

一、pom.xml添加依赖
二、yml或properties配置文件添加配置
1、数据库配置
2、mybaties配置

mybatis:
  type-aliases-package: com.li.entity
  configuration:
    map-underscore-to-camel-case: true

三、启动类配置

@SpringBootApplication
@MapperScan("com.li.mapper")

public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class,args);
    }
}

四、编写接口mapper继承

public interface OrderMapper extends Mapper<Order> {
}

五、或者编写BaseMapper
我的demo会出现泛型错误,待解决

标签:mapper,args,通用,springboot,DemoApplication,配置,li,public
来源: https://blog.csdn.net/weixin_45611186/article/details/117266877