Mybatis 错误:Error parsing Mapper XML. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias


mybatis\mapper\AdminMapper.xml]'; nested exception is 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 'Admin'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Admin]

ResultType要写全类名,不然会被作为Mybatis的Alias 。 使用了MybatisGenerator 可以使用resultMap="BaseResultMap" 自定做了封装

<select id="selectAdminByLoginAcct" resultMap="BaseResultMap">
  select id, login_acct, user_pswd, user_name, email, create_time from t_admin where
  login_acct = #{loginAcct}
</select>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM