摘要:之前学习到 DefaultSqlSessionFactory中的 private SqlSession openSessionFromDataSource(ExecutorType execType, TransactionIsolationLevel level, boolean autoCommit) { Transaction tx = null; try { fina...
阅读全文
摘要:参考文档中介绍Mybatis的中心是SqlSessionFactory.并举出一个简单的生成方法:String resource = “org/mybatis/example/mybatis-config.xml”;InputStream inputStream = Resources.getResourceAsStream(resource);SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().bulid(inputStream);文档列举的基本xml如下:configuration ...
阅读全文
摘要:之前就想学习一下开源代码,本来想从SSH框架开始学习,看了一下Hiberante的源码后,感觉学习起来比较吃力,所以打算先从MyBatis开始。一切从最简单开始,既是学习笔记,也是自己的学习记录,希望能通过记录的方式,让自己真的能完成整个学习的过程。mybatis网站下载mybatis最新的版本为3.2.3 下载地址:http://code.google.com/p/mybatis/downloads/detail?name=mybatis-3.2.3.zip解压后为mybatis的jar包,以及mybatis依赖的lib随后在http://repo1.maven.org/maven2/o..
阅读全文