摘要:
Mapper接口通过sqlSession的getMapper()方法获取,接口无法创建实例对象,获取到的是其代理对象,下面来看看Mapper接口的代理是如何创建的。 UserMapper mapper = sqlSession.getMapper(UserMapper.class) Mapper接口 阅读全文
posted @ 2023-03-20 21:51
无虑的小猪
阅读(608)
评论(0)
推荐(0)
摘要:
SqlSession对象创建核心在SQL执行器Executor对象的创建,sqlSession持有Executor对象。 1、SqlSession对象的创建 应用程序每次操作数据库,都需要创建一个sqlSession对象,通过sqlSession完成SQL语句的执行。下面来看看sqlSession的 阅读全文
posted @ 2023-03-20 18:14
无虑的小猪
阅读(776)
评论(0)
推荐(0)
摘要:
1、Mapper配置方式 1、package方式 指定包路径: <mappers> <package name="org.snails.mapper"/> </mappers> 2、resource方式 指定mapper.xml文件的相对路径: <mappers> <mapper resource= 阅读全文
posted @ 2023-03-20 17:54
无虑的小猪
阅读(573)
评论(0)
推荐(0)

浙公网安备 33010602011771号