org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: java.lang.NullPointerException
The error may exist in com/gaipian/dao/IAccoutDao.xml
The error may involve com.gaipian.dao.IAccoutDao.findAll
The error occurred while handling results
SQL: select u.*,a.ID as AID,a.UID,a.MONEY from account a,user u where a.UID = u.id
Cause: java.lang.NullPointerException
解决方式:注意在association标签中写javaType标签

本文详细解析了在使用MyBatis框架时遇到的PersistenceException异常,具体表现为查询数据库时出现NullPointerException。错误可能出现在com/gaipian/dao/IAccoutDao.xml文件中的IAccoutDao.findAll方法。文章提供了SQL查询语句,并指出问题可能源于association标签中未正确使用javaType属性。
856

被折叠的 条评论
为什么被折叠?



