博主使用的Springboot3.0,jdk17,Mybatis+MybatisFlex的环境
报错:
org.mybatis.spring.MyBatisSystemException: null
java.lang.RuntimeException: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0)
原因:
mybatis获取无法映射主键id,缺少注解
id属性上添加注解:
@Id(keyType = KeyType.Generator, value = KeyGenerators.flexId)