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