mybatis一键配置

复制代码
mybaits起步依赖
XML 复制代码
     <!-- mybatis的起步依赖 -->
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
        </dependency>

        <!-- mysql驱动 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
复制代码
mybatis-config.xml
XML 复制代码
​​​​​​​
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC
        "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <settings>
        <!-- 设置驼峰标识 -->
        <setting name="mapUnderscoreToCamelCase" value="true"/>
        <!-- 打印SQL语句 -->
        <setting name="logImpl" value="STDOUT_LOGGING"/>
    </settings>
    <plugins>
        <!-- 分页插件 -->
        <plugin interceptor="com.github.pagehelper.PageInterceptor"/>
    </plugins>
</configuration>

application-dev.xml

XML 复制代码
mybatis:
  config-location: classpath:mybatis-config.xml
  mapper-locations: classpath:/mapper/*.xml
相关推荐
正儿八经的少年20 小时前
MyBatis 一对一、一对多 SQL
数据库·sql·mybatis
SEO_juper21 小时前
Go 站点地图生成器:从首页爬全站,一键生成 sitemap.xml
xml·开发语言·人工智能·golang·node.js·seo·外贸独立站
paopaokaka_luck2 天前
社区服务平台(加权协同过滤推荐、Jieba中文词频分析、WebSocket实时聊天、求助处理闭环、 活动积分闭环、ECharts多维分析)
java·前端·spring boot·mysql·echarts·mybatis
可爱系程序猿3 天前
XML 导入失败并指向 msxml6.dll:用最小样本区分解析错误与组件加载
xml·程序人生·电脑
代码不停3 天前
MyBatis操作数据库
数据库·mybatis
wno7043 天前
Spring Boot中JdbcTemplate与Mybatis使用PostgreSQL
spring boot·postgresql·mybatis
lzhdim3 天前
100条常用SQL语句
数据库·sql·mysql·mybatis
SEO_juper3 天前
Node.js 重定向链检测工具:301 跳了几跳、有没有成环,一次看清
xml·开发语言·python·node.js·json·bash
步行cgn4 天前
Spring MVC 核心配置文件详解:springmvc.xml 每一行配置的意义
xml·spring·mvc
景熙55234 天前
2.什么是业务后台系统
java·spring·tomcat·mybatis·jdbc