2023年6月1日
摘要: MyBatis的Dao层实现方式 一、传统开发方式 1. 编写UserDao接口 public interface UserMapper { List<User> findAll() throws IOException; } 2. 编写UserDaoImpl实现 public class User 阅读全文
posted @ 2023-06-01 22:48 花溪月影 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 一、SqlSession工厂构建器SqlSessionFactoryBuilder 常用API:SqlSessionFactory build(InputStream inputStream) 通过加载mybatis的核心文件的输入流的形式构建一个SqlSessionFactory对象 其中,Res 阅读全文
posted @ 2023-06-01 22:38 花溪月影 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 一、MyBatis的插入数据操作 1. 编写UserMapper映射文件 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://myba 阅读全文
posted @ 2023-06-01 22:36 花溪月影 阅读(8) 评论(0) 推荐(0) 编辑