type
Post
status
Published
date
Dec 9, 2024
slug
mybatis
summary
记录myBatis的学习过程
tags
mybatis
category
后端技术
icon
password
概念
- 持久层框架,就是将数据添加进数据库里面
pom.xml的资源配置
Mappper层的xml文件开头
mybatis-config.xml(数据库的配置文件)
MybatisUtils.java(获取sql操作的工具类)
- 方法存在多个参数,所有参数前面必须加上@Parm(id)注解
- 若是mapper有xml,则mybatis-config.xml中的资源配置为:
- 若是mapper没有xml,用注解方式进行sql操作,则对应的资源配置为:
- @Data : 无参构造、get、set、toString、hashCode、equals
- @AllArgsConstructor:有参
- @NoArgsConstructor: 无参
- 作者:清弦子
- 链接:https://tangly1024.com/%E5%90%8E%E7%AB%AF%E6%8A%80%E6%9C%AF/mybatis
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
.jpg?table=collection&id=aeb9995f-c21f-83d9-b9b7-07efa597272a&t=aeb9995f-c21f-83d9-b9b7-07efa597272a)