我的mybatis
IDEA工程文件请见:
练习过程中的BUG:
1、
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'cn.edu.sdut.selectCount'. It's likely that neither a Result Type nor a Result Map was specified.
### The error may exist in mapper/Tbuser.xml
### The error may involve cn.edu.sdut.selectCount
### The error occurred while handling results
### SQL: SELECT COUNT(*) FROM tbuser
### Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'cn.edu.sdut.selectCount'. It's likely that neither a Result Type nor a Result Map was specified.
解决:加入结果类型(位置:mapper->Tbuser.xml)
2、
解决方案一:修改UserMapper.xml文件
解决方案二:
3、
解决方案:将1图改为2图
4、重要