报错内容如下

Optional int parameter 'id' is present but cannot be translated into a null value due to being declared as a primitive type.

解决办法

将 int 改成 Integer。

Integer 是基本数据类型 int 的包装类。int 的初值为 0,Ingeter 的初值为 null。

一般情况下,尽量使用 Integer ,而不是 int。

相关文章:

  • 2022-12-23
  • 2022-02-04
  • 2021-07-25
  • 2021-07-06
  • 2021-04-18
  • 2022-12-23
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
相关资源
相似解决方案