使用MybatisPlus插入数据异常

使用MybatisPlus插入数据异常,第1张

使用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

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/739771.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-28
下一篇 2022-04-28

发表评论

登录后才能评论

评论列表(0条)

保存