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
相关推荐
菜鸟蹦迪3 小时前
学习记录:mybatis和jdbc实现数据表作为参数的相关的sql操作
sql·学习·mybatis
diving deep13 小时前
XML简要介绍
xml·java·后端
JosieBook13 小时前
【VS】VS2019中使用rdlc报表,生成之前修改XML
xml
AI+程序员在路上1 天前
XML介绍及常用c及c++库
xml·c语言·c++
芯眼1 天前
STM32启动文件详解(重点)
java·开发语言·c++·stm32·单片机·mybatis
遗憾皆是温柔1 天前
MyBatis—动态 SQL
java·数据库·ide·sql·mybatis
炯哈哈1 天前
【上位机——WPF】App.xml和Application类简介
xml·开发语言·c#·wpf·上位机
xrkhy2 天前
java中XML的使用
xml·java·开发语言
huang_hai_an2 天前
jackson-dataformat-xml引入使用后,响应体全是xml
xml