随笔分类 -  mybatis

mybatis的sql操作
摘要:1.Mapper接口创建 创建Mapper包,所有的Mapper接口放在该包下。Mapper接口中声明将要实现的方法,在接下来的Mapper.xml文件中实现对应方法。 2.Mapper.xml创建 (1)在resources下创建与Mapper接口路径相同的包。如Mapper接口路径为“com.e 阅读全文
posted @ 2022-09-12 14:41 恒heng 阅读(107) 评论(0) 推荐(0)
创建sqlSession对象操作数据库
摘要:1.加载核心配置文件 //加载mybatis核心配置文件,获取SqlSessionFactory String resource = "mybatis-config.xml"; InputStream inputStream = Resources.getResourceAsStream(resou 阅读全文
posted @ 2022-09-12 14:20 恒heng 阅读(53) 评论(0) 推荐(0)
mybatis核心配置文件
摘要:<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.d 阅读全文
posted @ 2022-09-12 14:09 恒heng 阅读(19) 评论(0) 推荐(0)