得到MyBatis的Mapper对象

 

public staticT getSqlSession(Class clz)throws IOException {

InputStream is = Resources.getResourceAsStream("MyBatisConfig.xml");

SqlSessionFactory factory =new SqlSessionFactoryBuilder().build(is);

SqlSession sqlSession = factory.openSession(true);

T mapper = sqlSession.getMapper(clz);

return mapper;

}

得到MyBatis的Mapper对象

上一篇:axios 简介与安装


下一篇:uni-app下载文件在ios下失败