Method main should have no parameters

代码  main 中不需要添加@Test

public class MyTest {
public static void main(String[] args) {
// 1.获取SqlSession
SqlSession sqlSession = MyBatisUtils.getSqlSession();

// UserMapper mapper = sqlSession.getMapper(UserMapper.class);
// List<User> userList = mapper.getUserList();


// 2.方式一:getMapper
UserMapper mapper = sqlSession.getMapper(UserMapper.class);
List<User> userList = mapper.getUserList();


for (User user : userList) {
System.out.println(user);
}

}
上一篇:对狂神说的MybatisPlus的学习总结


下一篇:项目自动化建构工具gradle 入门0——环境 & 废话