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”