@Id@GeneratedValue(strategy=GenerationType.AUTO)private int id;
并在保留时将其保留为
null(0)。(
null如果使用
Integer/ Long包装器)
在某些情况下,该
AUTO策略被解析为
SEQUENCEto IDENTITY或
to TABLE,因此你可能需要手动将其设置为
IDENTITYor TABLE(取决于基础数据库)。
似乎
SEQUENCE+ 指定序列名称对你有用。

@Id@GeneratedValue(strategy=GenerationType.AUTO)private int id;
并在保留时将其保留为
null(0)。(
null如果使用
Integer/ Long包装器)
在某些情况下,该
AUTO策略被解析为
SEQUENCEto IDENTITY或
to TABLE,因此你可能需要手动将其设置为
IDENTITYor TABLE(取决于基础数据库)。
似乎
SEQUENCE+ 指定序列名称对你有用。