标签:vat exception private oid bat col list code nts
在进行 mybatis spring 整合中出现的,查明原因是因为在 UserMapperImpl中没有写接口方法的实现。
(使用UserMapperImpl的sqlSession属性)
实现如下:
public class UserMapperImpl implements UserMapper { //添加sqlSession属性 private SqlSession sqlSession; public void setSqlSession(SqlSession sqlSession) { this.sqlSession = sqlSession; } public List<User> getUser() { UserMapper mapper = sqlSession.getMapper(UserMapper.class); return mapper.getUser(); } }
Spring 的学习报错_____2.空指针异常 java.lang.NullPointerException
标签:vat exception private oid bat col list code nts
原文地址:https://www.cnblogs.com/xbfchder/p/11267221.html