时间:2021-07-01 10:21:17 帮助过:52人阅读
@Test
public void testProc(){
SqlSession sqlSession=null;
try{
sqlSession=sqlSessionFactory.openSession();
Author author = sqlSession.selectOne("com.autohome.mapper.Author.testProc",1);
System.out.println("作者信息 id:"+author.getId()+",name:"+author.getName());
System.out.println("作者博客:");
for(Blog blog:author.getBlogs()){
System.out.println("id:"+blog.getId()+",title:"+blog.getTitle()+",category:"+blog.getCategory());
}
}catch(Exception e){
e.printStackTrace();
}finally {
sqlSession.close();
}
}
附单元测试截图

MyBatis从入门到放弃五:调用存储过程(SQLServer2012)
标签:存储过程 test blog -128 创建 开发环境 sqlserver final get