使用MybatisPlus插入数据异常
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class com.zf.domain.Book' with value '1518884807361241089' Cause: java.lang.IllegalArgumentException: argument type mismatch
MP默认使用科赫雪花算法,而此处数据库id设置为自增策略 (需在spring配置文件中添加配置)
# 配置数据库自增策略
mybatis-plus:
global-config:
db-config:
id-type: auto
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)