SpringBoot整合MyBatis坑点
yml配置myBatis 别名后不生效
mybatis:
mapperLocations: classpath:mapper/*Mapper.xml
type-aliases-package: com.test.springcloud.entities
Error while adding the mapper
Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘Payment’. Cause: java.lang.ClassNotFoundException: Cannot find class: Payment
解决方法:
- myBatis配置类中设置别名
- 写全类名