记录使用Spring Boot+Mybatis-plus中用MybatisX生成代码时出现的一个错误

在使用Spring Boot和Mybatis-plus集成时遇到一个问题,IDEA报错:'org.springframework.beans.factory.UnsatisfiedDependencyException' 和 'MybatisPlusException: @TableId can't more than one in Class'。错误源于在'com.example.demo.po.Flight'类中定义了超过一个@TableId注解,这与数据库表中主键的限制冲突。解决方案是删除Flight类中多余的@TableId注解,并相应调整数据库表结构。
摘要由CSDN通过智能技术生成

IDEA错误提示:

1.===》org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'airplaneServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'airplaneMapper' defined in file [D:\IDEA_2020\Test3\target\classes\com\example\demo\mapper\AirplaneMapper.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 [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Fac

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值