public class TestStudentMapper {
SqlSessionFactory factory;
@Before
public void init(){
try {
InputStream in = Resources.getResourceAsStream("config/mybatis-config.xml");
SqlSessionFactoryBuilder sfb = new SqlSessionFactoryBuilder();
factory = sfb.build(in);
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void test01(){
//开启事务自动提交
SqlSession sqlSession = factory.openSession(true);
//获取dao层的代理对象
StudentDao studentDao = sqlSession.getMapper(StudentDao.class);
List<Student> s