天天看点

springboot2.X整合mybaits的坑 1.注意一个地方:mybaits扫描的包,是mapper,不是bean目录

1.注意一个地方:mybaits扫描的包,是mapper,不是bean目录
springboot2.X整合mybaits的坑 1.注意一个地方:mybaits扫描的包,是mapper,不是bean目录

不然报错:Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.apache.ibatis.type.TypeException: The alias 'Criterion' is already mapped to the value.............................

2.说明:别名包映射实体类包也行,但是不要使用

mybatis-generator生产的enableSelectByExample,enableDeleteByExample,selectByExampleQueryId。这些东西      

继续阅读