首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Criterion:别名“Criterion”已映射到值'com.xxx.domain.def.GameListExample$Criterion‘

Criterion:别名“Criterion”已映射到值'com.xxx.domain.def.GameListExample$Criterion‘
EN

Stack Overflow用户
提问于 2019-04-29 20:03:31
回答 1查看 1.9K关注 0票数 0

我使用mybatis生成器生成域和映射器。当我生成一个表时,它工作得很好。

当我生成另一个表时,问题就来了。它看起来像GameListExample和BetRecdExample中的Criterion类冲突,但它是由mybatis生成的。

代码语言:javascript
复制
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'betRecdMapper' defined in file 
[F:\IdeaProjects\game\target\classes\com\good\game\dao\def\BetRecdMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource 
[org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is 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 'com.good.game.domain.def.GameListExample$Criterion'.
EN

回答 1

Stack Overflow用户

发布于 2019-04-29 22:57:20

听起来和https://github.com/mybatis/generator/issues/461有同样的问题

它是由mybatis-spring 2.0.1中的一个bug引起的。

https://github.com/mybatis/spring/issues/362

当前的解决方法是使用mybatis-spring 2.0.0或2.0.2-SNAPSHOT。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55902991

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档