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
相关推荐
han_hanker5 小时前
sql语法 MyBatis <foreach> 标签详解
windows·sql·mybatis
前网易架构师-高司机5 小时前
带标注的21种中药材识别数据集,识别率73.8%数据集,2237张图,支持yolo,coco json,voc xml,文末有模型训练代码
xml·yolo·json·数据集·中药·药材·中草药
snow@li1 天前
Java:pom.xml全景深度分析 / 机制、标签、依赖、打包、生产避坑全解 / 工程基石
xml·java·开发语言
田里的水稻1 天前
EP_XML\JSON配置文件和YAML
xml·运维·人工智能·机器人·自动驾驶·json
xiangji1 天前
开源完美模块组件化可扩展的Xml解析器Hand.ParseXml
xml·模块化·组件化·可扩展
ByWalker_1 天前
web应用技术—MyBatis入门
java·数据库·mybatis·lombok
ylscode2 天前
Cloudflare Workers Cache 深度解析:边缘缓存如何重塑无服务器性能边界
java·spring·mybatis
我命由我123453 天前
Android 构建项目问题:XML 片段出错,com.ctc.wstx.exc.WstxUnexpectedCharException
android·xml·android studio·android jetpack·android-studio·android runtime
risc1234564 天前
Roaring Bitmap
java·开发语言·mybatis
PixelBai4 天前
JSON转XML使用教程:从入门到精通
xml·json