随笔分类 - mybatis
mybatis的sql操作
摘要:1.Mapper接口创建 创建Mapper包,所有的Mapper接口放在该包下。Mapper接口中声明将要实现的方法,在接下来的Mapper.xml文件中实现对应方法。 2.Mapper.xml创建 (1)在resources下创建与Mapper接口路径相同的包。如Mapper接口路径为“com.e
阅读全文
创建sqlSession对象操作数据库
摘要:1.加载核心配置文件 //加载mybatis核心配置文件,获取SqlSessionFactory String resource = "mybatis-config.xml"; InputStream inputStream = Resources.getResourceAsStream(resou
阅读全文
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
阅读全文
浙公网安备 33010602011771号