If the primary key is self increment, you have to add @GeneratedValue(generator = “JDBC”) on your entity’s field. Otherwise, the primary key can be got if you want to use it again.
@GeneratedValue(generator = “JDBC“)
最新推荐文章于 2022-09-07 01:12:33 发布
本文介绍了在实体类中如何正确配置自增主键。如果主键采用自增方式,则需在实体字段上添加@GeneratedValue注解,并指定generator为JDBC。此配置确保主键能被正确管理和使用。

2650

被折叠的 条评论
为什么被折叠?



