源码之家

  • 首页
  • 文章
  • 问答
  • 下载
您的位置: 首页  >  文章  >  SpringBoot使用(2)--集成mybatis

SpringBoot使用(2)--集成mybatis

分类: 文章 • 2024-10-11 22:19:34

本人使用yml格式来进行参数的配置(application.yml)

SpringBoot使用(2)--集成mybatis

mapperlocations:用来扫描映射的xml文件

因为我启动类没有放在controller service等的父包下面,所以我配置了@ComponentScan,如下

SpringBoot使用(2)--集成mybatis

@MapperScan是用来扫描mapper映射

controller,service没有特别的地方 ,配置好后启动并访问localhost:8080/getUser

SpringBoot使用(2)--集成mybatis

成功返回表中数据.亦可以在Mapper中使用mybatis的注解来进行CRUD

相关推荐

  • SpingCloud:springboot微服务集成ribbon+mybatis实现增删查(三)
  • SpringBoot集成Mybatis时mybatis.mapper-locations和@MapperScan的作用
  • _011_SpringBoot_集成MyBatis
  • SpringBoot使用mybatis插件自动创建****
  • SpringBoot2集成redis,使用lettuce客户端
  • 架构师基于微服务的项目使用 MockMvc完成SpringBoot2.x单元测试
  • 使用 Spring Cloud Bus 自动刷新配置(SpringBoot2.x版本)
  • springboot集成redis,使用@Cacheable导致java.lang.ClassCastException:异常
  • Springboot 集成oauth2多模块打包时候,oauth2模块内容始终不能被加载.
  • 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_3-2.使用Mybatis注解开发视频列表增删改查...
  • RabbitMQ学习笔记(1)——AMQP
  • ShardingSphere 与 Mycat
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 源码之家    备案号:   粤ICP备20058927号