Mybatis Generator 路徑和實體類要放的路徑不一致 導致Could not resolve type alias


Mybatis Generator 路徑和實體類要放的路徑不一致。會出現一系列的錯誤。手動修改alias也還是會報錯,直接重新生成

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
 Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: 
Failed to parse mapping resource: 'file [D:\IDEA_workspace\CrowdFunding\atcrowdfunding10-member-mysql-provider\target\classes\mybatis\mapper\MemberPOMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [D:\IDEA_workspace\CrowdFunding\atcrowdfunding10-member-mysql-provider\target\classes\mybatis\mapper\MemberPOMapper.xml]'. 
Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. 
Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cc.landfill.crowd.entity.MemberPO'. 
Cause: java.lang.ClassNotFoundException: Cannot find class: cc.landfill.crowd.entity.MemberPO

修改路徑為要生成后要放的包,重新生成一下

   <javaModelGenerator targetProject=".\src\main\java" targetPackage="cc.landfill.crowd.entity.po">
        <!-- enableSubPackages:是否讓 schema 作為包的后綴 -->


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM