MyBatis Error resolving class.Could not resolve type alias ‘xxx‘.Cannot find class:xxx问题描述

水深无声 2023-10-07 17:22 22阅读 0赞

问题描述:

Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘com.UserEntity’. Cause: java.lang.ClassNotFoundException: Cannot find class: com.UserEntity

问题分析:

1、使用Mybatis的select标签时,parameterType属性对应的类型不存在,导致报错。

  1. <select id="getUserList" resultType="com.entity.UserEntity" parameterType="com.UserEntity">
  2. SELECT *
  3. from users
  4. where username = #{username} and password=#{password}
  5. </select>

解决办法:

给parameterType属性设置正确的类型即可。

发表评论

表情:
评论列表 (有 0 条评论,22人围观)

还没有评论,来说两句吧...

相关阅读