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 作為包的后綴 -->