mybatis:Cause: org.apache.ibatis.type.TypeException问题解决

版权声明:转载请注明地址 https://blog.csdn.net/CAT_cwds/article/details/80691498

1.在SqlConfigMap.xml中配置typeAlises


2.在UserMapper.xml中作如下逻辑:


3.报错如下:

org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### The error may exist in com/zxy/mybatis/mapper/UserMapper.xml
### The error occurred while processing mapper_resultMap[userResultMap1]
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'userResultMap1'.  Cause: java.lang.ClassNotFoundException: Cannot find class: userResultMap1

4.后来查资料发现是UserMapper中的对应resultMap的属性写错了,应该为“resultMap”


阅读更多 登录后自动展开
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页