ResultMap

来源:互联网 发布:信盈达 知乎 编辑:程序博客网 时间:2024/05/29 18:18

这里写图片描述
column=”表中列” property=”model中类的属性名”
注意点:select 中的resultMap=“”

BUG:
org.apache.ibatis.exceptions.PersistenceException:

Error building SqlSession.

The error may exist in com/zhiyou/mapper/UserMapper.xml

The error occurred while processing mapper_resultMap[userResult]

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 ‘userResult’. Cause: java.lang.ClassNotFoundException: Cannot find class: userResult

这个错是因为,xxxMapper.xml里面关于userResult的地方写错了,要检查所有的跟userResult有关的地方,特别是resultType=”userResult”

原创粉丝点击