我的mybatis

IDEA工程文件请见:

mybatis框架应用工程文件 

练习过程中的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)

我的mybatis

2、

我的mybatis

解决方案一:修改UserMapper.xml文件

我的mybatis

解决方案二:

我的mybatis

3、

我的mybatis

解决方案:将1图改为2图

我的mybatis

我的mybatis

4、重要

我的mybatis

 我的mybatis