Mybatis不能正确解析typeAliases问题的处理方法( Could not resolve type alias 'Orders')

报错信息: 

org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### The error may exist in org/by4g/mybatis/mapper/UserMapper.xml
### The error occurred while processing mapper_resultMap[OrdersUserResultMap]
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: 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 'Orders'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Orders

原因:需要在mybatis的xml中配置  

   
     
    

注意:typeAliases放在environments前面就不会了,这个错误我也犯过

 

你可能感兴趣的:(Mybatis不能正确解析typeAliases问题的处理方法( Could not resolve type alias 'Orders'))