获取SqlSession的分析:
InputStream inputStream = Resources.getResourceStream("mybatis-config.xml");
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder.build(inputStream);
SqlSession sqlSession= sqlSessionFactory.openSession();
为什么说第一段代码读取了mybatis-config.xml和Mapper.xml
因为在mybatis-config.xml中有的标签
博客内容解析了如何通过mybatis-config.xml配置文件和SqlSessionFactoryBuilder创建SqlSessionFactory,进一步打开SqlSession,强调了mybatis-config.xml中mapper配置的重要性。
1万+

被折叠的 条评论
为什么被折叠?



